推送通知在分发中不起作用
好,现在我的推送通知有问题。我已经为开发部分成功设置了它们,并且正在设备上接收它们。现在,我在应用程序商店中拥有该应用程序,无法接收通知。
这是我的逐步操作:
Ok now I have a problem with the push notifications. I have set them successfully for the developing part and I was receiving them on my device. Now I have the application on app store and I cant receave notifications. This is step by step what I did:
-我创建了一个配置文件进行分发并将其连接到具有推送通知进行分发的应用程序ID和开发。
-I have created a provisioning profile for distribution and connected it to the app id that has push notifications for distribution and development.
-我已使用该配置文件构建了要分发的应用。
-I have built the app for distribution with that provisioning profile.
-我已提交应用程序商店中的应用程序。
-I have submitted the app on app store.
-现在我在钥匙串访问中有2个证书Apple Production IOS推送服务:AppID和iPhone分布:CompanyName
-Now I have 2 certificates in keychain access Apple Production IOS Push Service:AppID and iPhone Distribution:CompanyName
-我已经从两个文件中都创建了.pem文件,并对其进行了测试。没有通知到达
-I have made .pem file from both and tested it with both. No notification has arrived
我真的不知道该怎么尝试以及如何解决。
I really have no idea what to try and how to fix this.
就在几周前,我遇到了类似的问题。对我而言,情况是我在xCode中剩下几个配置文件。所以我需要做的是:
I have had similar problems, just a few weeks ago. For me the case was that I had several provisioning profiles left in xCode. So what I needed to do was:
- 转到管理器->设备->设置配置文件
- 为有问题的应用选择我的分发配置文件,然后将其删除。
- 转到developer.apple.com/iOS
- 转到分发个人资料,对其进行修改。
- 只需单击全选(这样我就可以不做任何更改就重新保存它),以某种方式在启用推证书后需要重新创建配置文件
- 下载新配置文件并将其安装到xCode
- 在Product-> Clean
- Go to Organizer -> Devices -> Provisioning Profiles
- Select my distribution profiles for the app in question, and delete them.
- Go to developer.apple.com/iOS
- Go to the distribution profile, modify it.
- Just clicked "select all" (so I could re-save it with no changes), somehow the profile needed to be re-created AFTER enabling the Push certificate
- Download the new profile and install it to xCode
- Clean project under Product -> Clean
现在,我制作了一个新发行版并对其进行了测试,然后它可以正常工作。
Now I made a new release and tested it and it worked. Maybe this workes for you as well.
编辑
这个答案中的红线是则当在应用程序中启用推送通知时,需要重新配置配置文件(即使眼前没有任何变化)。
Edit The red-thread in this answer is that when Push notification in the App is enabled, the provisioning profiles need to be re-done (even though, to the eye there are no changes).