我在 Google Play 商店中发布了一个 Android 应用程序,我想添加推送通知。 我试过 Parse.com我实现了 this guide 中提到的代码. 当我尝试发送测试推送时,Parse.com 说:`没有客户订阅广播推送 channel 。请仔细检查您是否已正确设置 SDK。
另外,当我去解析云时
仪表板 --> 推送通知 --> 发送推送
解析说:
您的应用程序没有任何可以向其发送通知的注册设备。
我确信我已经正确实现了所有代码!
最佳答案
我认为您忘记了(正如错误消息告诉您的那样)在设备上注册!
ParseUser user = new ParseUser();
user.setUsername("jondoe");
user.setPassword("123456");
user.setEmail("jon@gmail.com");
user.signUpInBackground(new SignUpCallback() {
public void done(ParseException e) {
if (e == null) {
// Hooray! Let them use the app now.
} else {
// Sign up didn't succeed. Look at the ParseException
// to figure out what went wrong
}
}
@Override
public void done(com.parse.ParseException arg0) {
// TODO Auto-generated method stub
}
});
在您的设备注册后,系统知道向谁发送通知! 此外,在您的 Parse.com 仪表板中的“数据浏览器”选项卡中,如果您单击左侧的“安装”,您必须看到一行。
关于android - 我想在我的 Android 应用程序中使用 "Parse Notification",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18772737/