Is there any way to test New google play referrer api without publishing the app in Google play store?

900 Views Asked by At

Recently Google released Google Play Install Referrer API (announcement).

there are various duplicates to this question but no clarity regarding it.

need a exact way of testing this code before publishing.

InstallReferrerClient mReferrerClient

mReferrerClient = InstallReferrerClient.newBuilder(this).build();
mReferrerClient.startConnection(new InstallReferrerStateListener() {
    @Override
    public void onInstallReferrerSetupFinished(int responseCode) {
        switch (responseCode) {
            case InstallReferrerResponse.OK:
                // Connection established
                break;
            case InstallReferrerResponse.FEATURE_NOT_SUPPORTED:
                // API not available on the current Play Store app
                break;
            case InstallReferrerResponse.SERVICE_UNAVAILABLE:
                // Connection could not be established
                break;
        }
    }

    @Override
    public void onInstallReferrerServiceDisconnected() {
        // Try to restart the connection on the next request to
        // Google Play by calling the startConnection() method.
    }
});
1

There are 1 best solutions below

0
On

For testing/debugging purposes you can use the following way:

  1. Open the referral link on your device (it will redirect to Play Market). Do not install app from play market!
  2. Do not close the Play Market application
  3. Execute "Run app" or "Build" process from Android Studio
  4. You will get all data like your app installed from referral link