
这就是我正在做的事情:
APNS.host = 'gateway.push.apple.com' APNS.pem = Rails.root + "lib/push_production.pem"APNS.port = 2195 APNS.send_notification(device_token,"Test send" )
结果呢?
=> nil
没有任何方法的反馈,没有我可以检查的日志文件.我已经尝试过生成和重新生成我的证书;一切似乎都没问题.我尝试用各种方式表达我的设备令牌,没有尖括号,字符组之间没有空格…… APNS不关心.
考虑到涉及的活动部件的数量,我知道这是一个棘手的问题.但有人可以建议去哪里看看吗?
解决方法 official documentation说:If you send a notification and APNs finds the notification malformed
or otherwise unintelligible,it returns an error-response packet prior
to disconnecting. (If there is no error,APNs doesn’t return
anything.) figure 5-3 depicts the format of the error-response packet.
因此,只有宝石不会返回任何内容才有意义,因为Apple的服务器不会让它知道它在做什么.另外,如果你看一下gem的github页面,给定的例子不会处理APNS.send_notification的返回值.
上次我使用Apple推送通知时,它几乎就像一个黑盒子,大部分时间都没有返回任何东西.
总结以上是内存溢出为你收集整理的ios – Ruby apns gem返回nil全部内容,希望文章能够帮你解决ios – Ruby apns gem返回nil所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)