【问题标题】:Push notifications only works in development gateway推送通知仅适用于开发网关
【发布时间】:2016-10-14 00:17:20
【问题描述】:

我已尝试使用 APN Tester Free 推送通知

when I try gateway development the notifications are pushed correctly, this is the log
2016-10-13 15:34:21 +0000: Disconnected from server gateway.push.apple.com:2195 
2016-10-13 15:34:21 +0000: Accessing gateway: gateway.sandbox.push.apple.com 
2016-10-13 15:34:21 +0000: Connected to server gateway.sandbox.push.apple.com 
2016-10-13 15:34:21 +0000: Set SSL connection 
2016-10-13 15:34:21 +0000: Set peer domain name gateway.sandbox.push.apple.com 
2016-10-13 15:34:21 +0000: Keychain Opened  
2016-10-13 15:34:21 +0000: Certificate  data  for Apple Push Services: com.SoyPlus.SoyPlusPartner initialized successfully 
2016-10-13 15:34:21 +0000: Sec Identity created 
2016-10-13 15:34:21 +0000: Client certificate created 
2016-10-13 15:34:21 +0000: Connected 
2016-10-13 15:34:24 +0000: Token: <df11354b 3862f4fa 91cb260d 03375616 35662a44 91c09c23 7cb13b62 5e31157f> 
2016-10-13 15:34:24 +0000: Written 76 bytes sending data to gateway.sandbox.push.apple.com:2195 

2016-10-13 15:34:24 +0000: Disconnected from server gateway.sandbox.push.apple.com:2195 

然后弹出通知

但是现在,当我将网关更改为 AdHoc/Production 时,我没有收到推送通知,这是日志:

2016-10-13 15:35:01 +0000: Accessing gateway: gateway.push.apple.com 
2016-10-13 15:35:01 +0000: Connected to server gateway.push.apple.com 
2016-10-13 15:35:01 +0000: Set SSL connection 
2016-10-13 15:35:01 +0000: Set peer domain name gateway.push.apple.com 
2016-10-13 15:35:01 +0000: Keychain Opened  
2016-10-13 15:35:01 +0000: Certificate  data  for Apple Push Services: com.SoyPlus.SoyPlusPartner initialized successfully 
2016-10-13 15:35:01 +0000: Sec Identity created 
2016-10-13 15:35:01 +0000: Client certificate created 
2016-10-13 15:35:01 +0000: Connected 
2016-10-13 15:35:02 +0000: Token: <df11354b 3862f4fa 91cb260d 03375616 35662a44 91c09c23 7cb13b62 5e31157f> 
2016-10-13 15:35:02 +0000: Written 76 bytes sending data to gateway.push.apple.com:2195 

2016-10-13 15:35:02 +0000: Disconnected from server gateway.push.apple.com:2195 

如何解决这个问题?我已尝试使用提供的两个证书(开发和生产)


注意:我在 Xcode Code Signing 中修改了身份

之前:

之后:

在我的 iPhone 上运行后问题仍然存在,我是否需要在 appstore 中发布并从那里安装以进行完整测试?

【问题讨论】:

    标签: ios push-notification apple-push-notifications


    【解决方案1】:

    要使用生产 SSL 证书,您的应用必须(在编译时)使用生产证书进行签名。 (如果您有企业计划,则用于 AppStore 或用于 AdHoc 部署)

    【讨论】:

    • 我已经根据您提出的建议更新了我的问题,只是想问一下是否正确?我可以从 Xcode 以生产模式运行我的应用吗???
    • 不,你不能,但你可以提交到AppStore,并访问testFlight
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-03-28
    • 1970-01-01
    • 2016-06-16
    • 1970-01-01
    • 1970-01-01
    • 2012-04-12
    相关资源
    最近更新 更多