iOS8 extension needs own provisioning profile?
Asked Answered
P

5

48

I am starting an iOS 8 extension but I can't run it on my device. The error when trying to run it is:

No matching provisioning profiles found

The provisioning profile specified in your build settings (“ExtensionName”) has an AppID of net.company.AppName which does not match your bundle identifier net.company.AppName.ExtensionName. Xcode can resolve this issue by downloading a new provisioning profile from the Member Center.

  1. Do I need a separate provisioning profile for both the main app and the extension ?
  2. Should they share a bundle identifier (by default it adds the extension name to the bundle identifier, so perhaps not) ?
  3. If it has a separate bundle identifier how is that reflected in the provisioning profile (if there is a separate one) ?
Plainsong answered 15/8, 2014 at 15:40 Comment(1)
I can't even count the number of times I've added a device to a provisioning profile and forgotten to add the device to the extension profile as well. It won't install (Ad-hoc/Enterprise deployment) unless both provisioning profiles are valid for the device.Palgrave
H
27

It would seem that Xcode would prefer it that way, however there's nothing stopping you from using a wildcard profile until you want to do an Adhoc or Release to the App Store. More to the point of your question though, for every target that you have, you need a profile and bundle ID. So yes, you "need" another provisioning profile for your Extension, although I expect Apple to streamline this process.

All in all, it's probably best to just use a WildCard dev profile until you need a provisioning profile. Remember this is all a beta, and they're still working on pretty much everything.

Halstead answered 15/8, 2014 at 15:50 Comment(4)
Trying to archive today (release of Xcode 6 GM and iOS 8 GM) and it wants provisioning profiles for extensions. Sigh.Buckra
WildCard profiles don't seem to support AppGroups, or possibly any other types of entitlements, so if you use this feature you need to make an explicit profile for your app and one for each extension.Stuck
Is this answer still up to date?Betseybetsy
@BradThomas Yep :). They didn't change much in terms of the code signing process other than the fact that they have a big fat "automate" button. Which I highly recommend using if you can.Halstead
S
12

Extensions are separate targets from the host app. You have to treat them as though they are separate apps with different bundle identifiers and different provisioning profiles.

It's best if you just create them during testing instead of using wildcards because you may need to test some capabilities that you enabled, for example App Group so that your extension and host app can access the same container.

Note that if you want to have any capabilities enabled for your host app and extensions, you have to enable them individually for all of them.

Scarcely answered 26/9, 2014 at 2:39 Comment(3)
Do I need to sign the extensions with the provisioning profiles of the host app?Littles
do i need to archive seprately extension ? or just archive main app and upload to appstore ?Saltatory
@Littles A provisioning profile is made of: 1 or more certificates + App ID + device list. Unless you're using wildcards for your App ID then the AppID of your host app and app extension are not the same. So you can't sign with the provisioning profile of the host app. Yet the cert is the same. The device list can be the sameRegen
N
11

I've located this documentation pertaining to App Extensions. If you read the bottom of page 20 if seems that using the same distribution certificate is actually suggested. I've gone ahead and changed my bundle identifier for the Today Extension to extend my applications. For example, com.DeveloperName.AppName.TodayExtension, created an App ID in the Dev Center to correspond with that, and created a distribution profile for it. My app +Quotes has successfully been updated by following these steps. I have not experienced any issues with the app or extension, but Xcode does seem to get a little confused when trying to auto assign the correct provisioning profiles for my extension now. Selecting them manually solves this.

Nonobedience answered 11/9, 2014 at 15:10 Comment(5)
Another user reported that you need separate certs: https://mcmap.net/q/218324/-provisioning-profile-for-today-widget-extensionJamijamie
The other user reported you need separate provisioning profiles. He said nothing about separate certificates.Calyptrogen
TodayExtension isn't the best name because thats the executable name in Xcode console for debug output. If too many devs use that process name debugging will become harder.Alasdair
The App Extensions link is brokenBetseybetsy
Daniel, you are right. Xcode is seriously annoying in this case. Manually selection worked for me too.Crossbeam
T
7

You do need a separate provisioning profile for you extension but with the same certificate your main app has. When you are creating a new provisioning profile, your Extension's app id will also appear in the list, choose that, and proceed to create a new provisioning profile.

Also choose that provisioning profile in the target of your extension.

enter image description here

Thurifer answered 22/6, 2016 at 6:54 Comment(1)
I'd also add that a new AppID should be created for each extension to make it appear in the AppIDs list.Outdated
A
1

I simply use "Automatically manage sign in" until I need to push to App store. This works out of the box with simulators, haven't tried with devices yet.

Few pointers for Appstore Build:

  1. I created one wildcard id for every notification extension, but the prefix of this wildcard bundle id should match your app's bundle id as prefixed. If it's not like this, this error will come up: "Embedded binary's bundle identifier is not prefixed with the parent app's bundle identifier". So, if your app's bundle-id is: "com.companyName.appName", the wildcard bundle-id for your extension should be "com.companyName.appName.*". You can then replace * with a specific notification extension in the XCode. Note apple only allows one period(".") after the app's bundle id for naming your extension's bundle id.
  2. The version and build number of your extension should match that of your app.
  3. Once App Id is created, create a distribution provisioning profile with this and use it in XCode.
Aurita answered 28/5, 2019 at 12:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.