尝试向 iOS 设备发送推送通知 - 未收到它们 [英] Attempting to sent Push Notifications to iOS device - not receiving them

查看:42
本文介绍了尝试向 iOS 设备发送推送通知 - 未收到它们的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我已经完成了以下工作:- 生成的证书和私钥为 .pem,也将它们组合在一起.成功连接到 gateway.sandbox.push.apple.com.- 使用带有推送通知的临时配置文件已启用开发,我有一个基本的应用程序成功提示你想允许推送通知吗",所以这是正常工作- 获得设备令牌- 我曾尝试将一些用于 SSL 的预制文件从 Internet 提取到沙箱中,只是为了在开始开发之前查看是否可以让它们运行.

I have so far done the following: - Generated certificate and private key as .pem, also cat'd them together. Successfully connected to gateway.sandbox.push.apple.com. - Using the provisional profile with push notifications is enabled for development, I have a basic app that successfully prompted "Do you want to allow push notifications", so this is working correctly - Obtained the device token - I have tried pulling a few pre-made files for SSLing into sandbox from the internet just to see if I can get them running before I start development.

文件是贴在这里的 php 文件:http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12.我实际上收到了消息发送成功"

The files are the php file posted here: http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12. I actually got a "Message successfully sent"

这里发布的python文件:Apple PNS(推送通知服务)示例代码;我不得不将 Python 3 命令fromhash"行编辑为 str(float.fromhash(...))

The python file posted here: Apple PNS (push notification services) sample code; I had to edit the Python 3 command "fromhash" line to str(float.fromhash(...))

我也尝试使用 PyAPNs API:https://github.com/simonwhitaker/PyAPNs.我仍然将 use_sandbox 设置为 true.

I also tried using the PyAPNs API: https://github.com/simonwhitaker/PyAPNs. I still have use_sandbox set to true.

显然,我将设备令牌和公钥/证书更改为我自己的.遗憾的是,我还没有收到任何推送通知,也没有收到任何具体的错误来告诉我原因.如果有人能阐明一些观点,那就太棒了.

Obviously I changed the device tokens and public keys/certificates to my own. Sadly I have not received any pushed notifications yet, and I'm not receiving any concrete errors to tell me why. If anyone can shed some light, that would be amazing.

推荐答案

来自我在 radesix 的回答中的评论,很抱歉我无法提供更多细节,因为我接触 iOS 开发已经一年了.

From my comment in radesix's answer, and apologies that I can provide no more detail as it's been a year since I've touched iOS development.

问题是我的临时配置文件将aps-environment"键设置为开发人员,但出于某种原因,xcode 默认为调试".在编辑器中更改此设置解决了我的问题.

The problem was my provisional profile had the "aps-environment" key set to developer, but for some reason xcode defaulted to "debug". Changing this in the editor solved my problem.

这篇关于尝试向 iOS 设备发送推送通知 - 未收到它们的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆