저는 MiXPanel 콘솔의 모든 내용을 MixPanel Push Notification Documentation에 설치했습니다. 나는 구글과 MixPanel Docs에서 Needfull을 찾음으로써 나의 2 일을 낭비했다.MixPanel 푸시 알림을받지 못했습니다.
MIXPANEL_PROJECT_ID_TOKEN :
은 여기 내 코드 내가 사용하고
private void initMixPanelForPush() { try { MixpanelAPI mMixpanel = MixpanelAPI.getInstance(this, ConstantsLib.MIXPANEL_PROJECT_ID_TOKEN); MixpanelAPI.People people = mMixpanel.getPeople(); people.initPushHandling(ConstantsLib.PROJECT_NUMBER); people.identify(AppSharedPrefs.getInstance(context).getUserId()); people.setPushRegistrationId(AppSharedPrefs.getInstance(context).getDeviceToken()); people.showNotificationIfAvailable(this); AppController.getInstance().getAnalyticInstance().getAnalyticsContext().putDeviceToken(AppSharedPrefs.getInstance(context).getDeviceToken()); } catch (Exception ex) { ex.printStackTrace(); } }
변수입니다 내가 mixPanel ProjectSetting-> 관리 -> 토큰에서 그것을 얻을.
PROJECT_NUMBER : project_number 구글 - service.json에서 푸시 알림을 얻기를위한 수신기를 등록 파일
.
의 AndroidManifest.xml
<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="my_package _name" />
</intent-filter>
</receiver>
세그먼트 아이디로 전송. 내가 선택 사용자 MixPanel에서 푸시를 내보내지만, 장치에 받고 있지 않다
Traits traits = new Traits();
traits.putName(basicDetails.getFullName());
traits.putEmail(basicDetails.getContactEmail());
traits.putPhone(basicDetails.getContactNumber());
traits.putValue("userId", basicDetails.getUserId());
traits.putValue("android_devices", AppSharedPrefs.getInstance(context).getDeviceToken());
getAnalyticInstance().identify(AppSharedPrefs.getInstance(this).getUserId(), traits, null);
(장치 토큰은 여기에 추가된다).
내가 실수 한 부분을 알려주십시오.
내가 지금은 MixPanel에서 푸시 얻고,이 문제를 해결 한