为临时分发环境启用 Apple 推送通知
我已成功实施 APN 开发环境。但我在针对临时分发环境实施相同的操作时遇到了问题。 有人可以建议我是否需要为此创建不同的应用程序 ID、证书和配置文件? Sandbox 有什么变化吗? 步骤教程将非常有用。
谢谢 萨利尔·卡卡尼斯
I have successfully implemented APN for development Environment. But i am facing problems while implementing the same for ad-hoc distribution environment.
Can anybody please suggest me do i need to create different App Id , Certificate and Provisioning Profile for that?
And is there any change in Sandbox?
A tutorial of steps will be very much appriciated.
Thanks
Saleel Karkhanis
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
对于 Adhoc 分发,请按照以下说明操作:
如何在测试设备上加载 adHoc 发行版:
要使推送通知在临时分发上工作:
For Adhoc distribution, Please follow the instructions below:
How to load the adHoc distribution on the test device:
For Push Notifications to work on Adhoc distribution:
我在这方面也遇到了很大的问题。我的代码绝对没有错误。我只是从来没有在 Ad Hoc 的手机上收到过推送通知。
事实证明我的证书有一些问题。我创建了
我不太确定问题是什么,但我通过以团队代理身份登录我的开发者帐户并在该登录名下重新创建所有内容来解决它。我最初是作为团队管理员创建的证书。
您的开发模式可能工作得很好,因为任何团队成员都可以创建开发分发配置文件。但只有某些团队成员可以创建分发配置文件。让您的团队代理创建所有内容并重试。
I had major problems with this as well. I had absolutely no errors in my code. I just never got a push notification on the phone in Ad Hoc.
It turns out that I had some sort of problem with my certificates. I created
I'm not really certain what the problem was, exactly, but I solved it by logging into my developer account as the team agent and recreating everything under that login. I had originally created the certificates as a team admin.
Your development mode may work just fine, since any team member can create development distribution profiles. But only certain team members can create distribution profiles. Have your team agent create everything and try it again.
每个环境(开发和生产)都有一个单独的到推送服务的持久连接。操作系统与沙盒环境建立持久连接以进行开发构建;特别和分发构建连接到生产环境。
如果您使用的是 GCM。转到您的 AppDelegate.swift。查找方法:didRegisterForRemoteNotificationsWithDeviceToken 并替换
为
There is a separate persistent connection to the push service for each environment (Development and Production). The operating system establishes a persistent connection to the sandbox environment for development builds; ad hoc and distribution builds connect to the production environment.
If you are using GCM. Go to your AppDelegate.swift. Find method: didRegisterForRemoteNotificationsWithDeviceToken and replace
with
除了苏什玛·萨蒂什的回答之外,
当您将证书从development 更改为distributon 时,为您的手机生成的设备令牌会有所不同。
因此,请确保您正在更改服务器上的设备令牌。
In addition to Sushma Satish's answer ,
When you change certificates from developement to distributon , the device token generated for your phone is different.
So make sure you're changing the device token on the server.