# @dudod/capacitor-plugin-install-referrer

> Plugin to retrieve and use the google play install referrer. Copied from https://www.npmjs.com/package/@togetherprice/capacitor-plugin-install-referrer?activeTab=readme

Latest version **1.0.14** (published 2023-01-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @dudod/capacitor-plugin-install-referrer
pnpm add @dudod/capacitor-plugin-install-referrer
yarn add @dudod/capacitor-plugin-install-referrer
bun add @dudod/capacitor-plugin-install-referrer
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.14 |
| Published | 2023-01-10 |
| First published | 2022-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 20 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | dudod |
| Keywords | capacitor, plugin, native |

## Links

- npm: https://www.npmjs.com/package/@dudod/capacitor-plugin-install-referrer
- Repository: https://github.com/dmitry-udod/capacitor-plugin-install-referrer
- Homepage: https://github.com/dmitry-udod/capacitor-plugin-install-referrer#readme
- Issues: https://github.com/dmitry-udod/capacitor-plugin-install-referrer/issues
- npm.io page: https://npm.io/package/@dudod/capacitor-plugin-install-referrer

## Recent versions

- 1.0.14 (latest) — 2023-01-10
- 1.0.13 — 2023-01-10
- 1.0.12 — 2022-12-12
- 1.0.11 — 2022-12-12
- 1.0.10 — 2022-12-12
- 1.0.9 — 2022-12-12
- 1.0.8 — 2022-12-12
- 1.0.7 — 2022-12-12

## README

# @dudod/capacitor-plugin-install-referrer

Copy of **togetherprice/capacitor-plugin-install-referrer**

Original plugin: https://www.npmjs.com/package/@togetherprice/capacitor-plugin-install-referrer

Plugin to retrieve and use the Google play
[install referrer](https://developer.android.com/google/play/installreferrer)

## Install

```bash
npm install @dudod/capacitor-plugin-install-referrer
npx cap sync
```

### Android

Register the plugin by adding it to you MainActivity's onCreate:

```java
import com.togetherprice.capacitor.installreferrer.InstallReferrerPlugin;

public class MainActivity extends BridgeActivity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    registerPlugin(InstallReferrerPlugin.class);
  }
}
```

## API

<docgen-index>

* [`getReferrerDetails()`](#getreferrerdetails)
* [Interfaces](#interfaces)

</docgen-index>

<docgen-api>
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

### getReferrerDetails()

```typescript
getReferrerDetails() => any
```

Return the `install referrer` passed to the store when installing the app, if any.

Usage:
```
import { InstallReferrer } from '@dudod/capacitor-plugin-install-referrer';

const referrer = await InstallReferrer.getReferrerDetails();

```

**Returns:** <code>ReferrerDetails</code>

--------------------


### Interfaces


#### ReferrerDetails

| Prop                            | Type                 | Description                                                               |
| ------------------------------- | -------------------- | ------------------------------------------------------------------------- |
| **`referrerUrl`**               | <code>string</code>  | The install referrer passed to the store when installing the app, if any. |
| **`referrerClickTime`**         | <code>number</code>  | The install referrer click time.                                          |
| **`appInstallTime`**            | <code>number</code>  | The app install time.                                                     |
| **`instantExperienceLaunched`** | <code>boolean</code> | If the instant experience was launched.                                   |

</docgen-api>

## Test

Add a referrer parameter to any URLs that will be linking directly to Google Play Store and set the value of that parameter to a string that describe the source, as in this example:

```text
https://play.google.com/store/apps/details?id=com.example.application
&referrer=utm_source%3Dgoogle
%26utm_medium%3Dcpc
%26utm_term%3Drunning%252Bshoes
%26utm_content%3Dlogolink
%26utm_campaign%3Dspring_sale
```

Install the app from the store if the app is release, install the app locally if not.

---
_Source: https://npm.io/package/@dudod/capacitor-plugin-install-referrer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
