我在Manifest.xml中声明了这样的接收器:
<receiver android:name=".receivers.MyTrackerReceiver"
android:exported="true">
<intent-filter android:priority="998">
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
<service android:name="com.google.android.gms.analytics.CampaignTrackingService" />
<receiver android:name="com.google.android.gms.analytics.CampaignTrackingReceiver"
android:exported="true"
android:permission="android.permission.INSTALL_PACKAGES">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
我的自定义接收器是
public class MyTrackerReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Bundle extras = intent.getExtras();
String referrerString = extras.getString("referrer");
Log.v("referrer ", referrerString);
SharedPreferenceUtils.getInstance(context).setReferrer(referrerString);
new CampaignTrackingReceiver().onReceive(context, intent);
}
}
但是onReceive
中的CampaignTrackingReceiver
没有被调用,我错过了,谢谢!
答案 0 :(得分:-2)
现在正在使用向接收器发送广播存在一些问题