我正在使用解析作为我的iOS应用程序发送推送通知的后端。我的问题是,应用程序图标收到推送通知后从未显示徽章(除了徽章,一切工作正常)。应用程序徽章不显示解析推送通知
我检查在解析安装DB的“徽章”字段,它与每一个推的增加,所以我觉得这可能是一个客户端问题
这里是我的云代码:
Parse.Push.send({
where: pushQuery,
data: {
aps: {
alert: "Your friend " + request.user.get("Name") + " just joined VoiceMe!",
sound: "default",
AlertType: "NewFriend"
},
badge: "Increment"
}
}, {
success: function() {
/*all is good*/
},
error: function(error) {
outcome = false;
errorOutput = error;
}
});
而且在我的应用程序的代码:解析上安装数据库的
func application(application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: NSData) {
let currentInstallation = PFInstallation.currentInstallation()
if PFUser.currentUser() != nil {
currentInstallation.setObject(PFUser.currentUser()!, forKey: kParseInstallationUserKey)
}
currentInstallation.setDeviceTokenFromData(deviceToken)
currentInstallation.channels = ["global"]
currentInstallation.saveInBackgroundWithBlock { (resultBool, error) -> Void in
println("register device: --- \(resultBool) ---- error: \(error)")
}
}
图片:
徽章需要进入aps字典块。不在其外面 – soulshined
我试图把它放在aps字典的外面,但它不会增加安装数据库中的徽章数量? – Lneuner
这就是为什么我说它进入 – soulshined