iosazure-devopsxamarin.iosapple-push-notificationsios-provisioning

Signing iOS application for internal deployment with Push Notifcations


We have an iOS application which we create using Xamarin.

We are starting to use Apple Push Notification Services and I have updated our App Identifier in developer.apple.com to use the Push Notifications capability.

I have updated our Entitlements Plist with the one being used by our development and test environments with:

<key>aps-environment</key>
<string>development</string>

and this in the Plist that will be used for production:

<key>aps-environment</key>
<string>production</string>

I am able to deploy a signed application to a local device from within Visual Studio 2019 using "Manual Provisioning". I am also able to send push notifications to the installed app from Azure

Our test team downloads builds from AppCenter and we deploy to AppCenter using a YAML Pipeline.

I have looked inside the provisioning profile that is used by that pipelineto create the Test builds and it has

<key>aps-environment</key>
<string>production</string>

That does not match what is in the Entitlements PList and whilst the app builds and signs it will not open. Any attempts to open the app are given an error dialog saying

Unable to install because its integrity could not be verified

The aps-environment differs from the provisioning profile to the Entitlements.Plist. Does this explain that error?

Can I edit the XML of the provisioning profile and change the aps-environment?

If not how do choose from Apple Dev portal what provisioning profile to use in my automated build. I have the following types to choose from

I'm assuming it is the development one. I tried using a development one but I need to pair that with the correct certificate need by the InstallAppleCertificate task.

When I switched to the development provisioning profile I got the following error trying to build and sign the application

No iOS signing identities match the specified provisioning profile 'ecc36e48-b330-4341-834f-34747ebc010e'


Solution

  • Your test team should use Ad Hoc. Development is for debugging locally; Ad Hoc is for testers; and AppStore is for distribution to the public. The only way to test with an AppStore profile is via TestFlight. Development and Ad Hoc require the UUIDs to be set in the developer portal AND added to the profile. Anything not Development is considered "production" for APS.

    Our test team downloads builds from AppCenter and we deploy to AppCenter using a YAML Pipeline.

    Are you doing a iPhone | Ad Hoc build? In your csproj, do you have the correct entitlements and provisioning profile selected? Those are usually under the CodesignKey and CodesignEntitlements xml tags.