Skip to content

byorty/cordova-install-referrer-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova Play Install Referrer API

This plugin captures the referrer value passed when an android app is installed using Play Install Referrer API.

Install

cordova plugins add cordova-install-referrer-api

Usage

cordova.plugins.referrer.get().then((referrer) => {
    console.log(referrer);
    
    // Result:
    // {
    //     clickTimestamp: 0,
    //     installBeginTimestamp: 0,
    //     referrer: "utm_source=google-play&utm_medium=organic"
    // }    
}).catch((error) => {
    console.error(error);
    
    // Result:
    // {
    //     error: 1
    // }
});

Error codes

Code Description
-1 Play Store service is not connected now
0 Success
1 Could not initiate connection to the Install Referrer service
2 Install Referrer API not supported by the installed Play Store app
3 General errors caused by incorrect usage

About

Cordova Play Install Referrer API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published