[英]mixpanel push notification is sending 2 notifications
我在我的應用程序中使用mixpanel,我從mixpanel收到2個通知。 我已經在我的設備上使用gcm進行聊天了。 如何同時收到mixpanel和我的通知。 順便說一句,我通過代碼生成GCM reg_id。
清單文件:
<receiver
android:name=".gcm.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter android:priority="100">
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name=“com.example.Mainactivity.gcm" />
</intent-filter>
</receiver>
<receiver android:name="com.mixpanel.android.mpmetrics.GCMReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.example.Mainactivity.gcm" />
</intent-filter>
</receiver>
<service android:name=".gcm.GcmIntentService" />
我已經添加了 :
mixpanel.registerSuperProperties(props);
mixpanel.identify(id);
mixpanel.getPeople().identify(id);
mixpanel.getPeople().setPushRegistrationId(reg_id);
mixpanel.getPeople().initPushHandling(SENDER_ID);
在我的GcmBroadcastReceiver中我添加了:
if (intent.getExtras().containsKey("mp_message")) {
String mp_message=intent.getExtras().getString("mp_message");
}
檢查您是否在多人的屬性中添加了相同的設備令牌(以逗號分隔)
正如您所說,您之前實施了GCM,之后又集成了Mixpanel。 在這種情況下,您應該刪除官方文檔中提到的Mixpanel GCMReceiver標記:
如果您自己處理注冊和接收通知,則不應在AndroidManifest.xml文件中包含Mixpanel GCMReceiver標記。
https://mixpanel.com/help/reference/android-push-notifications
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.