简体   繁体   English

Android推送通知设备令牌

[英]Android push notifications device token

I've registered and enabled push notifications in my code, but on parse.com my device token is "undefined", so are badge and channels. 我已经在代码中注册并启用了推送通知,但是在parse.com上,我的设备令牌“未定义”,徽章和渠道也是如此。 Any suggestions as to why. 关于为什么的任何建议。 Thanks. 谢谢。

If you are working on emulator like Genymotion you can try this code for register parse.com 如果您正在使用Genymotion之类的模拟器,则可以尝试以下代码进行注册parse.com

Parse.initialize(this, "YOUR API KEY", "YOUR APP KEY");
        PushService.subscribe(this, "CHANNELNAME", YOURCLASSNAME.class);
        PushService.setDefaultPushCallback(this, YOURCLASSNAME.class);
        ParseInstallation.getCurrentInstallation().saveInBackground();
        ParseAnalytics.trackAppOpened(getIntent());

I hope it will work. 我希望它能起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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