Code Monkey home page Code Monkey logo

cordova-android-referrer's Introduction

Android Install Referrer

Fork of https://bitbucket.org/yauhenko/cordova-referrer Originally created by yauhenko

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

Install

cordova plugins add https://github.com/kovalyovkirill/cordova-android-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"

cordova-android-referrer's People

Contributors

kovalyovkirill avatar yauhenko avatar

Watchers

James Cloos avatar

Forkers

julian-ladjani

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.