0.1.3 • Published 5 years ago

by.redstream.referrer v0.1.3

Weekly downloads
2
License
ISC
Repository
bitbucket
Last release
5 years ago

Android Install Referrer

This plugin captures the referrer value passed when an android app is installed from a webpage.

Install

cordova plugins add by.redstream.referrer

Usage

To use this plugin, add &referrer=xyz to app install links on your webpages. For example:

https://play.google.com/store/apps/details?id=your.package.id&referrer=referrer-value

API

// Callback style
cordova.plugins.referrer.get(success, error);

// Promise style
let promise = cordova.plugins.referrer.get();

Example

// Callback style
cordova.plugins.referrer.get((referrer) => {
    console.log(referrer);
}, (error) => {
    console.error(error);
});

// Promise style
cordova.plugins.referrer.get().then((referrer) => {
    console.log(referrer);
}).catch((error) => {
    console.error(error);
});

Testing

To test that the install referrer event is received by the plugin in your emulator:

run adb shell and then

am broadcast -a com.android.vending.INSTALL_REFERRER \
-n <your.package.id>/by.redstream.referrer.receiver \
--es "referrer" "referrer-value"
0.1.3

5 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago