title: Signing iOS application for internal deployment with Push Notifcations
body: <p>We have an iOS application which we create using Xamarin.</p>
  <p>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.</p>
  <p>I have updated our Entitlements Plist with the one being used by our development and test environments with:</p>
  <pre><code>&lt;key&gt;aps-environment&lt;/key&gt;
  &lt;string&gt;development&lt;/string&gt;
  </code></pre>
  <p>and this in the Plist that will be used for production:</p>
  <pre><code>&lt;key&gt;aps-environment&lt;/key&gt;
  &lt;string&gt;production&lt;/string&gt;
  </code></pre>
  <p>I am able to deploy a signed application to a local device from within Visual Studio 2019 using &quot;Manual Provisioning&quot;. I am also able to send push notifications to the installed app from Azure</p>
  <p>Our test team downloads builds from AppCenter and we deploy to AppCenter using a YAML Pipeline.</p>
  <p>I have looked inside the provisioning profile that is used by that pipelineto create the Test builds and it has</p>
  <pre><code>&lt;key&gt;aps-environment&lt;/key&gt;
  &lt;string&gt;production&lt;/string&gt;
  </code></pre>
  <p>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</p>
  <blockquote>
  <p>Unable to install because its integrity could not be verified</p>
  </blockquote>
  <p>The aps-environment differs from the provisioning profile to the Entitlements.Plist. Does this explain that error?</p>
  <p>Can I edit the XML of the provisioning profile and change the aps-environment?</p>
  <p>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</p>
  <ul>
  <li>AppStore</li>
  <li>Ad hoc</li>
  <li>Development</li>
  </ul>
  <p>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.</p>
  <p>When I switched to the development provisioning profile I got the following error trying to build and sign the application</p>
  <blockquote>
  <p>No iOS signing identities match the specified provisioning profile
  'ecc36e48-b330-4341-834f-34747ebc010e'</p>
  </blockquote>