简体   繁体   中英

Parse push notification android issue

I use parse push notification for my app. According to the parse document i registered phone as

if(ParseInstallation.getCurrentInstallation().get("MyPhone") != null 
   && ParseInstallation.getCurrentInstallation().get("MyPhone").toString().length() > 0) {
    ParseInstallation.getCurrentInstallation().remove("MyPhone");
}
ParseInstallation.getCurrentInstallation().add("MyPhone", Session.getInstance().user.userNumber);
ParseInstallation.getCurrentInstallation().saveInBackground();

when i push from parse it recieve to the device and in parse it also show sent to 1 user. But sometimes it doesnt recieve to mobile device and i check the push log. That phonenumber register in push with id but it shows send to 0 users.

Thanks in advance.

It might be due to GCM. The trick that works for me was to add Parse GCM Sender ID when I register my app for GCM.

Right now, when you register for GCM, you might have something like this

gcm.register(YOUR_SENDER_ID);

Now, try to add Parse Sender ID this way :

gcm.register(YOUR_SENDER_ID, "1076345567071");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM