title: App ID & bundle identifier: provisioning profile issues
body: <p>I'm working on an Ionic 3 project and just now getting around to setting up and testing notifications. I don't have prior native iOS development experience, so I've been following a few guides on how to get all the proper certificates, provisioning profiles, and other setup done correctly.</p>
  
  <p>I have an Apple Developer account which I've added to Xcode and have so far been letting Xcode (version 8.3.3) handle signing automatically.</p>
  
  <p>I'm implementing notifications as part of Mixpanel integration, so I've been following this guide: <a href="https://mixpanel.com/help/reference/ios-push-notifications" rel="nofollow noreferrer">https://mixpanel.com/help/reference/ios-push-notifications</a>. This guide is pretty complete- it walks the user through creating an app ID, adding push, creating &amp; signing the required certs, creating a provisioning profile, and finally uploading those to Mixpanel. The entire process went fine.</p>
  
  <p>When I connected my device in order to try and test push notifications, I started having issues building- I hadn't added the push notification Capability in Xcode, so I did that- however, when I did so, I started getting an error in the code signing config that my provsioning profile didn't include that capability. Weird, because in the details of my App ID on the Apple Developer site, I see that push notifications are enabled for development.</p>
  
  <p>Upon closer inspection, I think the issue is that my App ID bundle identifier (on the Apple Dev site) and the bundle identifier in Xcode don't match. My App ID bundle identifier is:</p>
  
  <pre><code>&lt;team_ID&gt;.com.&lt;domain&gt;.app
  </code></pre>
  
  <p>But my bundle identifier in Xcode is:</p>
  
  <pre><code>com.&lt;domain&gt;.app
  </code></pre>
  
  <p>At the time I created the App ID, I thought the <code>&lt;team_ID&gt;</code> prefix was required for the bundle identifier in the App ID setup- but I don't think that's right. I see the prefix separately in the App ID info:</p>
  
  <p><a href="https://i.stack.imgur.com/Nrdjl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Nrdjl.png" alt="App ID info"></a></p>
  
  <p>Was this the wrong thing to do? The reason I got confused and added the team ID to my App ID bundle identifier was because my bundle identifier from Xcode (<code>com.&lt;domain&gt;.app</code>) wasn't allowed. The error I got when trying to use it while creating an App ID:</p>
  
  <p><a href="https://i.stack.imgur.com/eOybj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eOybj.png" alt="error creating app id"></a></p>
  
  <p>To be clear- I have no other App IDs in the Apple Developer profile with this bundle identifier.</p>
  
  <p>I know this identifier should be available because I've been using it in Xcode before today, with the same signing identity. Why wouldn't I be allowed to use it to create an App ID- isn't the point that the bundle ID must be the same both in that and in Xcode?</p>
  
  <p>The final confusing point here (to me) is that I decided to change the bundle identifier in Xcode to match that of my App ID (to confirm that, once they matched, building would work). After I did that, Xcode seemed to accept the new bundle identifier, but I get different build errors- and if I change my signing identity, the errors that show up in the signing config don't make sense- they reference a bundle identifier that isn't the one just above in Xcode:</p>
  
  <p><a href="https://i.stack.imgur.com/5ZKKw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5ZKKw.png" alt="weird config error"></a></p>
  
  <p>Specifically, why does the bundle identifier in the error not match what's set in the config at the top of the image? I've tried restarting Xcode and this still happens. At this point, I can't even build with Xcode if I remove the push capability- I get a mysterious <code>Apple Mach-O Linker (ID) error</code> which doesn't turn up much when googling.</p>