Enable Push Notification

Simon.5621Simon.5621 USMember ✭✭

I have some problems activating push for my Xamarin.iOS App.
I activated push in the App Id in the Apple Webportal:

First i tested uploading the ipa to the AppStore. It worked but i got the follwoing Email:

"Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature's entitlements do not include the "aps-environment" entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the "aps-environment" entitlement. Xcode 8 does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor's Capabilities pane, or manually add the entitlement to your entitlements file. For more information, see https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1."

Then i added this to my entitlements.plist:

<plist version="1.0">
<dict>
  <key>aps-environment</key>
  <string>production</string>
</dict>
</plist>

I tried both, "production" and "development". Both times i get the following error when trying to upload the ipa:

"ERROR ITMS-90163: "Invalid Code Signing Entitlements. The entitlements in your app bundle signature do not match the ones that are contained in the provisioning profile. The bundle contains a key that is not included in the provisioning profile: 'aps-environment' in 'Payload/CheckListApp.iOS.app/CheckListApp.iOS'."

I don't really know whats the problem. First it says "Add the aps-environment entitlement to your app bundle because you specified it in your provisioning profile" and if i do that it says "the entitlement is NOT included in the provisioning profile".

What am i doing wrong here ?

Answers

  • Mr.PearceMr.Pearce DEMember ✭✭
    edited July 2017

    please check if all your provisioning profiles are "active" if so.
    try to delete and redownloading them
    go to ~/Library/MobileDevice/Provisioning and delete all of them
    then go to Xcode -> preferences -> accounts "Download All Profiles"

    Also restart visual studio to let it load the correct profiles

  • Simon.5621Simon.5621 USMember ✭✭
    edited July 2017

    Hi, thanks for your answers. I'll try deleting the provisioning profiles locally, maybe something with an old App ID is stuck there. About the "Upload the certificate": I'm not sure this is necassary, in my understanding this certificate is only needed when implementing some kind of backend that communicates with the Apple Notification Server. Am i wrong there? In fact i had these certificates created and added, and it didn't work either. I deleted them afterwards because some tutorial said they are not needed.

  • GhyltGhylt USMember

    Simon, did deleting and redownloading the provisioning profiles work for you?

Sign In or Register to comment.