ios - 静默通知不会在 TestFlight 中发送

标签 ios parse-platform ios8 push-notification apple-push-notifications

我的应用严重依赖静默通知向用户发送数据。此功能在开发中运行良好,但当我使用 TestFlight 进行测试时,它不起作用。我读到这可能是某些 iOS 版本中的错误,但我没有运行它们中的任何一个。我正在使用 parse 发送推送通知,它说通知已发送,但它没有执行任何代码 didReceiveRemoteNotification 有谁知道为什么这不起作用?

Parse.Push.send({
    where: pushQuery,
    data: {
        "content-available" : 1,
        "sound" : "",
        "time" : alarmTimeDate,
    },
    push_time: alarmTime
}, { }).then(function() {
    response.success("Push was sent successfully.")
}, function(error) {
    response.error("Push failed to send with error: "
+ error.message);
});
},

error: function(user, error) { // error is an instance of Parse.Error. } });

 });

最佳答案

所以我终于得出了结论。事实证明,在 iOS 8 中,静默通知并不能保证在使用生产证书时执行 didReceiveRemoteNotification 中的代码。在开发中,它的工作方式与在 iOS 7 中一样,但在生产中则不同。您可以阅读更多相关信息 here. “Apple 并没有承认这种背景行为的变化是一个错误,他们承认这种变化但说这是故意的。” - mungbeans

希望这对遇到同样问题的人有所帮助,很抱歉通知您这个消息。因此,我需要重建我的整个应用程序。

关于ios - 静默通知不会在 TestFlight 中发送,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29324554/

相关文章:

parse-platform - 正在进行的 parse.com 请求是否继续计入 API 限制?

ios - 从解析中拉出对象后如何从 parse.com 对象访问其他属性/列(swift)

ios - 'NSInvalidArgumentException',原因 : 'Unable to parse constraint format

ios - AutoLayout:在 UIStackView/UITableViewCell 中缩放 UIImageView 时出现问题

objective-c - 在 iOS 上将 Wordpress JSON 解析为 UITableView

IOS 8.3 UIPopoverController 中的任何 UISegmentedControl 色调为白色且不可调节

iOS TestFlight 构建通知电子邮件反复未收到

ios - 使用多个图像循环 UIImage 淡入淡出过渡

android - 多对多关系

iphone - 在 iOS8 中使用 UISearchBar 启用取消按钮