2012-09-30 38 views
2

使用開發證書時,推送通知正常工作。當我在特設發行版中切換到生產證書時,應用程序無法註冊推送通知。在UIApplicationDelegate中,didRegisterForRemoteNotificationsWithDeviceTokendidFailToRegisterForRemoteNotificationsWithError都不會被調用。此外,當我在設備日誌接過來一看,我發現這一點:僅在使用生產證書時無法註冊推送通知

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 

我的權利在供應配置文件關鍵是這樣的:

<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> 

我試圖從兩個Xcode和刪除調配譜門戶並重新創建它們,我也嘗試撤消證書並重新創建它們。我甚至改變了應用程序ID,並從頭開始做所有事情。

我也試過建立有和沒有單獨的權利文件。

更新

我現在在設備上使用發行配置文件的調試。該應用程序現在在生產服務器上成功註冊並接收推送通知,但仍將應用程序歸檔推送通知。

所以現在我幾乎可以肯定Xcode在歸檔應用程序時會搞砸一些東西。

回答

1

我猜對了,Xcode確實在歸檔應用程序時搞砸了一些東西。選擇「Save for Enterprise or Ad-Hoc Deployment」後,代碼簽名標識下拉菜單顯示我的團隊名稱爲'(null)'。

enter image description here

刷新代碼簽名身份後,它現在顯示正確,並且特設IPA現在註冊並接收推送通知,通常我的設備上。

1

您是否更改過服務器中的APNS腳本?

ssl://gateway.sandbox.push.apple.com:2195需要; ssl://gateway.push.aple.com:2195和

development_certificate.pem應該是; production_certificate.pem

+0

問題在於註冊Apple服務器。我使用的是UrbanAirship,但這並不重要,因爲didRegisterForRemoteNotificationsWithDeviceToken永遠不會被調用。 –

+0

對不起,我的壞...我以爲你說你沒有收到他們,你沒有登記在第一位... – Bartu