[英]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.