Google即将弃用intall_referrer意图。我发现Google解析型CampaignTrackingReceiver在我们的项目中正在使用它。从清单添加代码以供参考:
<receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
android:enabled="true"
android:exported="true"
android:permission="android.permission.INSTALL_PACKAGES">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
如何用Firebase Analytics取代它?
在这里找到答案:
检查上面的链接,这是与使用CampaignTrackingReceiver
的旧方法匹配的代码部分>
// Tracker for Classic GA (call this if you are using Classic GA only)
private void trackInstallReferrer(final String referrerUrl) {
new Handler(getMainLooper()).post(new Runnable() {
@Override
public void run() {
CampaignTrackingReceiver receiver = new CampaignTrackingReceiver();
Intent intent = new Intent("com.android.vending.INSTALL_REFERRER");
intent.putExtra("referrer", referrerUrl);
receiver.onReceive(getApplicationContext(), intent);
}
});
}