Update Google Install Referrer
Follow
What's the change?
On November 2019 Google announced that Install Broadcast receiver will not receive any install data from Google Play on March 2020.
Article : [Still Using InstallBroadcast? Switch to the Play Referrer API by March 1, 2020]
<application> ... <receiver android:name="com.myapp.googleInstallReferrerReceiver" android:exported="true"> <intent-filter> <action android:name="com.android.vending.INSTALL_REFERRER" /> </intent-filter> </receiver> ... </application>
[Receiver that using com.android.vending.INSTALL_REFERRER no longer works]
In March 2020, Google play will send install data only on Google's new InstallReferrer API.
dependencies { implementation 'com.android.installreferrer:installreferrer:1.1' }
[To receive Google Referrer data, app needs to add a new Google InstallReferrer library.]
Need to Update AdBrix SDK?
AdBrix SDK already integrates both a broadcast receiver and Google InstallReferrer library.
To update these change simply delete the broadcast receiver set on Androidmanifest.xml.
[[인용:위험:보통]]Warning!!!
To receive Google Install Referrer you need to add Google InstallReferrer Library on gradle. If you need more infomation please check AdBrix SDK Integration guide
Guide : [AdBrix Integration (JAVA) : Gradle setup]
Please remove these broadcast receiver
<receiver android:name="myapp.packagename.MyMultipleInstallReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER"/>
</intent-filter>
</receiver>
<receiver android:name="com.igaworks.v2.core.AbxReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
Get Google Install Referrer Data
Sometimes you need to get Google Install Referrer data by yourself.
These are the sample code that gets Google install Referrer data using 'com.android.installreferrer:installreferrer:1.0' Library.
/** * To get Google install referrer data you have to connect Google play first. * When onInstallReferrerSetupFinished result is Seccess you can use method that get a Google Referrer * These sample code base on 'com.android.installreferrer:installreferrer:1.0' * * */ boolean isEnableTisEnableToGetGoogleInstallRefererDataoGetGR = false; InstallReferrerClient referrerClient; referrerClient = InstallReferrerClient.newBuilder(MyActivity.this).build(); referrerClient.startConnection(new InstallReferrerStateListener() { @Override public void onInstallReferrerSetupFinished(int responseCode) { switch (responseCode) { case InstallReferrerClient.InstallReferrerResponse.OK: // Connection established. isEnableToGetGoogleInstallRefererData = true; break; case InstallReferrerClient.InstallReferrerResponse.FEATURE_NOT_SUPPORTED: // API not available on the current Play Store app. break; case InstallReferrerClient.InstallReferrerResponse.SERVICE_UNAVAILABLE: // Connection couldn't be established. break; } } @Override public void onInstallReferrerServiceDisconnected() { // Try to restart the connection on the next request to // Google Play by calling the startConnection() method. } }); /** * Try to get google referrer data when connection to Google play is success * * */ try { if(isEnableToGetGoogleInstallRefererData == true){ ReferrerDetails response = referrerClient.getInstallReferrer(); String referrerUrl = response.getInstallReferrer(); long referrerClickTime = response.getReferrerClickTimestampSeconds(); long appInstallTime = response.getInstallBeginTimestampSeconds(); } } catch (RemoteException e) { e.printStackTrace(); }