推送通知在生产环境中不工作从沙箱切换后 [英] Push Notification not working in production environment after switched from sandbox

查看:263
本文介绍了推送通知在生产环境中不工作从沙箱切换后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所以我目前很迷茫,不知道下一步该怎么做。我花了过去的两个星期让这些推送通知才能正常工作,而当我终于拥有这一切干净整洁,我把它变成一个即席分布包和切换服务器配置到生产环境,突然没有什么作品,我没有错误消息,熄灭的。它应该工作,应该工作,它没有。所以,我需要一些帮助,因为我迷路了。

Hi so I'm very confused at the moment and don't know what to do next. I've spent the last two weeks getting these push notifications to work correctly, and when I finally have it all neat and tidy, I put it into an adhoc distribution bundle and switch the server configurations to the production environment, suddenly nothing works and I have no error messages to go off of. It should work, it should work and it doesn't. So I need some help because I'm lost.

可能出现的问题 -

possible problems -

HOST CONFIG

真正帮助我把它摆在首位的工作是本教程的此处,托管服务器是Heroku和应用程序使用写在辛纳屈的宝石,如果不以某种方式我没有看到结转到生产环境中,请告诉我。要更新环境到生产,我只是改变使用了哪个键,如下图所示,从gateway.sandbox.push.apple.com到gateway.push.apple.com主机:

What really helped me get it working in the first place was this tutorial here, the hosting server is Heroku and the application is written in Sinatra using this gem, and if that doesn't carry over to production environment in someway I am not seeing please tell me. To update the environment to production, I just changed which key was used and the host from gateway.sandbox.push.apple.com to gateway.push.apple.com as shown here:

APNS键

我不认为这是这一点,但我不明白是怎么回事,所以我记录它,但分布键的作品,我相信 - 运行

I don't think it's this, but I don't understand what is going on so I documented it, but the distribution key works I believe - running

openssl s_client -connect gateway.push.apple.com:2195 -cert dis_apskey.pem 

在终端得到这个连接和事务的推送服务器:

in the terminal got this connection and transaction with the push server:

我相信这意味着它的工作,虽然我不知道你肯定(见答案编辑,这并不意味着它的工作)。按键用该命令所做的:

Which I believe means it worked though I don't know for sure (see edit in answer, this does NOT mean it worked). The keys were made with this command:

openssl pkcs12 -in aps_distribution.p12 -out dis_apskey.pem -nodes

从APS发展的私钥和证书分发从iOS开发门户或不管它现在被称为下载,导出的.p12加密文件:

from the private keys of the APS Development and Distribution certificates downloaded from the iOS development portal or whatever it is called now, exported as .p12 encrypted files:

不过,虽然来自不同的私钥他们并转出极其类似的(所有字符都一样) -

Though, while from different private keys they did turn out strangely similar (all characters are the same)-

是正常吗?因为我来自同一个企业社会责任提出两个推送服务证书,我不知道我完全失去了...只是把它扔在那里,因为没有这个有意义了。

Is that normal? because I made both the push service certificates from the same CSR, I dunno I'm totally lost... just throwing it out there, because none of this makes sense anymore.

code SIGNING

我相信这是正确的(从我的X code项目):

I believe this is correct (from my xcode project):

这些对应于我的iOS开发者门户网站的证书和移动供给配置文件和我有再生那么多新的,在X code,双重检查他们刷新并重新加载他们这件事,我会找到它很难相信这是问题的区域。但只是为了确保我张贴,这些都是当前配置的APS证书发出后作出的。同样,这并不能使一大堆的道理给我,是的,我读过的文件,它仍然希腊。

Those correspond to the certificates and mobile provisioning profiles in my iOS Developer Portal and I have regenerated so many new ones, refreshed them in xcode, double checked and reloaded them in to this thing that I'd find it hard to believe this is the area of issue. But just to make sure I'm posting it, those are current profiles, made after the APS Certificates were issued. Again, this doesn't make a whole lot of sense to me and yes, I've read the documentation and it's still greek.

MOBILE DEVICE TOKENS

这一次,我没有看到是问题。我的应用程序使用的发展概况生成一个令牌和沙箱能够推送通知它和它优美的工作!然后,我的应用程序生成一个新的令牌,当我切换到即席形象和构建但与生产环境得到没有通过它。我再说一遍,一切都在沙箱正常工作,但现在没有。

This again, I don't see being the issue. My app generated one token using the development profile and the sandbox was able to push notifications to it and it worked BEAUTIFULLY! Then my app generated a NEW token when I switched to the adhoc profile and build BUT with the production environment nothing gets through to it. I'll say again, everything was working correctly on the sandbox but does not now.

其他原因?

这是所有我能想到的,如果任何人有别的东西,请让我知道。我只是想这个工作,我无法看到错误,如果苹果将其发送回推失败,所以我没有任何线索。它在开发人员沙盒工作,现在应该工作,这就是我能想到的。

That's all I can think of, if anyone has something else please let me know. I just want this working and I can't see the errors if apple sends them back to failed pushes so I have no clue. It was working in the developer sandbox and should be working now, that's all I can think of.

感谢。

推荐答案

所以经过长时间的问题买了挫折跨越两天。什么工作。 <一href=\"https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ProvisioningDevelopment.html#//apple_ref/doc/uid/TP40008194-CH104-SW3\"相对=nofollow>阅读

So after a long problematic bought of frustration spanning two days. What worked. Reading

我需要出口这两个项目

接着质子交换膜转化

和成功!

编辑:我还应该注意到,在这个问题的SSL连接gateway.push.apple.com的画面不是正确的连接,使用这里的答案产生的新的质子交换膜键插座没有亲密马上。您应该能够在那里输入一些东西它关闭之前。

I should also note that the picture of the ssl connection to gateway.push.apple.com in the question was NOT a correct connection, using the new .pem key here produced by the answer the socket does not "close" immediately. You should be able to type something there before it's closed.

这篇关于推送通知在生产环境中不工作从沙箱切换后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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