将 google play 服务更新到 7.0.3 后,我的自定义 INSTALL_REFERRER 广播接收器坏了。我使用 CampaignTrackingService(也获得了更新)将意图转发给谷歌分析。
在 AndroidManifest.xml 中
<receiver
android:name="myapp.analytics.installReferrer.InstallReferrerBroadcastReceiver"
android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
还有我的自定义广播接收器(这是问题所在):
public class InstallReferrerBroadcastReceiver extends BroadcastReceiver{
private final static String TAG = InstallReferrerBroadcastReceiver.class.getSimpleName();
@Override
public void onReceive(Context context, Intent intent) {
// Send to Different Analytics services
// Send to Google Analytics
CampaignTrackingService campaignTrackingService = new CampaignTrackingService();
// I used onHandleIntent() in google-play services 7.0.0, in 7.3.0 its gone
campaignTrackingService.onHandleIntent(intent);
}
}