项目作者: swayangjit

项目描述 :
Cordova plugin to retrieve referral content from Google play using Google Play Store's Install Referrer API.
高级语言: Java
项目地址: git://github.com/swayangjit/cordova-plugin-play-installreferrer.git
创建时间: 2020-06-15T17:02:54Z
项目社区:https://github.com/swayangjit/cordova-plugin-play-installreferrer

开源协议:Apache License 2.0

下载


cordova-plugin-play-installreferrer


npm version

License




License


Cordova plugin to retrieve referral content from Google play using Google Play Store’s Install Referrer API(Android)

API

The plugin exposes the following method:

  1. installReferrer.getReferrer(success, error);

Parameters:

  • success: success callback
    The response object will have the object which contains all the referrer details and some of the common attributes are following

    . responseCode: response code(0/1/2)
    . clickTs: Referrer link click time stamp
    . installTs: Install time stamp
    . isInstantExperienceLaunched: whether instant app launched or not

  • error: error callback

Notes

  • By default if the plugin method is called then the response will be like following
  1. {
  2. "clickTs": "0",
  3. "installTs": "0",
  4. "isInstantExperienceLaunched": "false",
  5. "responseCode": "0",
  6. "utm_medium": "organic",
  7. "utm_source": "google-play"
  8. }
  1. {
  2. "clickTs": "<valid_ts>",
  3. "installTs": "<valid_ts>",
  4. "isInstantExperienceLaunched": "false",
  5. "responseCode": "0",
  6. "utm_medium": "cpc",
  7. "utm_source": "google"
  8. }

Installation

The plugin can be installed via Cordova-CLI and is publicly available on NPM.

Execute from the projects root folder:

  1. $ npm i cordova-plugin-play-installreferrer
  2. $ cordova plugin add cordova-plugin-play-installreferrer

Or install a specific version:

  1. $ npm i cordova-plugin-play-installreferrer@<latest_version>
  2. $ cordova plugin add cordova-plugin-play-installreferrer@<latest_version>

Or install the latest head version:

  1. $ cordova plugin add https://github.com/swayangjit/cordova-plugin-play-installreferrer.git

Or install from local source:

  1. $ cordova plugin add <path> --nofetch --nosave --link