而只使用生产证书不能用于推送通知注册 [英] Can't register for push notifications while using production certificate only

查看:132
本文介绍了而只使用生产证书不能用于推送通知注册的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

推送通知使用开发证书时工作正常。当我在特设的分布切换到生产证书的应用程序无法推送通知登记。在UIApplicationDelegate,既不 didRegisterForRemoteNotificationsWithDeviceToken 也不 didFailToRegisterForRemoteNotificationsWithError 被调用。此外,当我在设备日志接过来一看,我发现这一点:

Push notifications are working fine when using development certificates. When I switched to a production certificate in my ad-hoc distribution the app fails to register for push notifications. In the UIApplicationDelegate, neither didRegisterForRemoteNotificationsWithDeviceToken nor didFailToRegisterForRemoteNotificationsWithError get called. Additionally when I took a look at the device logs I found this:

Sep 30 12:47:09 Heshams-iPad amfid[483] <Error>: entitlement 'aps-environment' has value not permitted by a provisioning profile
Sep 30 12:47:09 Heshams-iPad amfid[483] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile
Sep 30 12:47:09 Heshams-iPad amfid[483] <Error>: entitlement 'aps-environment' has value not permitted by a provisioning profile
Sep 30 12:47:09 Heshams-iPad amfid[483] <Error>: entitlement 'aps-environment' has value not permitted by a provisioning profile
Sep 30 12:47:09 Heshams-iPad amfid[483] <Error>: entitlement 'application-identifier' has value not permitted by a provisioning profile

我应得的供应配置文件关键是这样的:

My entitlements key in the provisioning profile looks like this:

<key>Entitlements</key>
<dict>
    <key>application-identifier</key>
    <string>KUK8W9TW2G.com.startappz.ConversableDemo</string>
    <key>aps-environment</key>
    <string>production</string>
    <key>get-task-allow</key>
    <false/>
    <key>keychain-access-groups</key>
    <array>
        <string>KUK8W9TW2G.*</string>
    </array>
</dict>

我试图删除从两个X code和门户网站,并重新创建它们的配置资料,我也试图吊销证书并重新创建它们。我甚至已经改变了应用程序ID和所做的一切从头开始。

I have tried deleting the provisioning profiles from both Xcode and the portal and recreating them, I have also tried revoking the certificates and recreating them. I have even changed the app id and did everything from scratch.

我也尝试过使用和不使用单独的权利文件创建。

I have also tried building with and without a separate entitlements file.

更新

我现在正在调试用发行配置文件在设备上。该应用程序现在注册并接收生产服务器上成功推送通知,但仍归档应用程式的空档推送通知。

I'm now debugging on the device using a distribution provisioning profile. The app now registers and receives push notifications successfully on the production servers, but still archiving the app breaks push notifications.

所以,现在我几乎可以肯定归档应用程序,当X code是搞乱的东西。

So now I'm almost sure Xcode is messing up something when archiving the app.

推荐答案

我是猜对的,归档应用程序时,X code的确实是搞乱的东西。经过选择另存为企业​​或特设部署中,code签署身份下拉菜单中显示为我的球队的名字'(空)。

I was guessing right, Xcode was indeed messing up something when archiving the app. After selecting "Save for Enterprise or Ad-Hoc Deployment", the code signing identity drop down menu was showing my team name as '(null)'.

刷新code签署后的身份它现在显示正确,并且特设IPA现在注册并接收推送通知通常我的设备上。

After refreshing the code signing identities it's now showing up properly and the ad-hoc ipa now registers and receives push notifications normally on my device.

这篇关于而只使用生产证书不能用于推送通知注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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