Android推送通知设备令牌

时间:2014-08-06 04:17:27

标签: android push-notification parse-platform

我已在我的代码中注册并启用了推送通知,但在parse.com上,我的设备令牌是"未定义",徽章和频道也是如此。任何关于为什么的建议。感谢。

1 个答案:

答案 0 :(得分:0)

如果你正在使用像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());

我希望它能奏效。