我正在使用mixpanel推送通知和我现有的gcm结构。如何将两者合并为一个。目前它没有在mixpanel上注册我的reg_id。
代码:
mixpanel.getPeople().setPushRegistrationId(reg_id);
如果我使用下面的整个代码,我会得到2个通知。如何让单一通知和混合面板调查一起工作?
清单:
<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");
}