react-native-referrer

<!-- badge --> [![npm version](https://img.shields.io/npm/v/react-native-referrer.svg)](https://www.npmjs.com/package/react-native-referrer) [![npm license](https://img.shields.io/npm/l/react-native-referrer.svg)](https://www.npmjs.com/package/react-nativ

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
react-native-referrer
0.1.45 years ago6 years agoMinified + gzip package size for react-native-referrer in KB

Readme

react-native-referrer
npm version npm license npm download npm download

Getting started

$ npm install react-native-referrer --save

Mostly automatic installation

$ react-native link react-native-referrer

Manual installation

Android

  1. Open up android/app/src/main/java/[...]/MainActivity.java
  2. Add import com.jdc.reactlibrary.RNReferrerPackage; to the imports at the top of the file
  3. Add new RNReferrerPackage() to the list returned by the getPackages() method
  4. Append the following lines to android/settings.gradle:
``` include ':react-native-referrer' project(':react-native-referrer').projectDir = new File(rootProject.projectDir, '../nodemodules/react-native-referrer/android') `` 3. Insert the following lines inside the dependencies block in android/app/build.gradle`: ``` compile project(':react-native-referrer') `` 4. Insert the following lines inside the application block in android/app/src/main/AndroidManifest.xml`: ```xml
<intent-filter>
  <action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
    </receiver>
```

Usage

import RNReferrer from 'react-native-referrer';

...
const referer = await RNReferrer.getReferrer();