iOS8 extension needs own provisioning profile? - ios

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.
Do I need a separate provisioning profile for both the main app and the extension ?
Should they share a bundle identifier (by default it adds the extension name to the bundle identifier, so perhaps not) ?
If it has a separate bundle identifier how is that reflected in the provisioning profile (if there is a separate one) ?

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.

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.

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.

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.

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:
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.
The version and build number of your extension should match that of your app.
Once App Id is created, create a distribution provisioning profile with this and use it in XCode.

Related

Cannot generate app-group provisioning profile or get one that matches

I have an iOS app with an app group to receive inbound images from other apps. I simply cannot get it to sign. I have gone through signing a bunch so the process is very familiar but I can't even get the group identifier to show up under provisioning in the developer center. Can someone help? Here is the scenario ->
I cannot create a provisioning profile for my app group group.com.xxxxxx.bookapp.
I have made a new app group identifier group.com.xxxxxx.bookapp.
I have added it to my app identifier in com.xxxxxx.bookapp under capabilities in the dev center, and selected group.com.xxxxxx.bookapp and it looks correct.
I have regenerated all my provisioning profiles.
The app will build fine until it gets to the share extension target and it says Provisioning profile "Provisioning Profile Name" has app ID "com.xxxxxx.bookapp", which does not match the bundle ID "com.xxxxxx.bookapp.shareextension".
I cannot generate a provisioning profile for "com.xxxxxx.bookapp.shareextension" because it does not show up in the lists of available id's in the developer portal when I try to create a new profile.
I cannot use wildcard because I have push notifications and the share extension will not allow it anyways
Ok so, it turns out you have to create a whole new app id that goes with your app group, add the same app group to it as your main target, then create a provisioning profile for it like it is its own app. Now I am able to publish like its two completely different apps, which is kinda is, just a bit convoluted and the docs don't really mention this.

Provisioning profile for Today Widget extension

I am trying to archieve my app for submission however I am running into issues with code signing.
Basically I have a Today Widget extension for my app. I am unsure about what I should be setting the provisioning profile as. I assumed that I would just use the same profile that I have used for my app, however I get this error:
The provisioning profile specified in your build settings (“AppName”) has an AppID of “BundleID” which does not match your bundle identifier “BundleID2”. Xcode can resolve this issue by downloading a new provisioning profile from the Member Center.
I can of course click 'Fix Issue', but does this actually solve the problem? It just changes my distribution settings to 'iOS Developer' and providing profile to 'Automatic'.
I was struggling with the same problem, and resolved it this way:
You need one App ID configured to the provisioning portal (I assume you have your com.apple.yourappname there)
You need to then configure the second App ID for the Today Widget (which should be com.apple.yourappname.something, where something is the name for your widget, like Today)
Then you need to create two App Store Distribution provisioning profiles:
One for the main App
Second one for the widget
Then assign the correct provisioning profiles for each target to the project settings and set to build for Distribution.
My problem was because of i added "arm" in the Excluded architecture section. I revert it and the problem goes away. It is weird.
Try to create a new App Id for your App extension in Certificates, Identifiers & Profiles (https://developer.apple.com/account). Then create a Provisioing profile for the newly created App id.
If the bundle id for your App is com.apple.appname you create an app extensions with the bundle id com.apple.appname.appextensionname. The same id is then used in Xcode for the widget.

Weird "The executable was signed with invalid entitlements" error... seems caused by iOS 8 sharing?

Due to iOS 8 sharing, I've had to create a bundle ID and provisioning profile for sharing. This new bundle ID is linked to my existing bundle ID through an app group, and my entitlements file specifies the app group. Now, however, my wildcard provisioning profile doesn't work. When I try to build, Xcode says "The executable was signed with invalid entitlements". Only when I use the provisioning profile with a specific bundle ID does it work. It's becoming a huge issue for my company.
Any ideas? We want to use a wildcard because we add devices a lot, and a wildcard doesn't require a refresh of our provisioning profiles for all the devs.
When you need to use special entitlements (iCloud, push notifications, etc.) you can no longer use wildcard IDs. You will need to create a unique ID on Apple's dev site for each of your app that needs these capabilities, if each of the apps need to be installed at the same time on one device.
If your different apps will never need to be installed by the same person, you could get by having multiple apps use the same bundle ID, but I wouldn't recommend it. If someone has App A on the device, and at some point in the future needs to install app B, it will replace it, and could cause problems if the app uses things like Core Data.

Need to force Xcode 5 to not use wildcard provisioning profile

I'm trying to use the new Automatic Configuration in Xcode 5 and it seems that when I run builds on my iPhone it is downloading the wildcard provisioning profile and using that to run the app. This is no good because my app uses push notifications and the wildcard will not have the correct entitlements to register for push notifications.
Is there a way to specify to use the provisioning profile for the qualified app id so I can test push notifications?
Strategies I have considered:
Delete wildcard app id - You cannot do this
Delete wildcard provisioning profile - Xcode will recreate the wildcard provisioning profile
Specify the provisioning profile explicitly in the target's build settings
I don't know how to determine the explicit name with Xcode 5. I could download and open the profile in a text editor, but that can't possibly be the right way to do this
If I specify the provisioning profile, I will need to update it every time a new profile is generated (add a new device, profile expires, signing certificate expires). This defeats the purpose of automatic configuration.
I've poked around Xcode looking for such a setting and haven't seen anything useful
I have followed the steps here (for configuring Push Notifications) and when I refresh my provisioning profiles they are not updated.
Any ideas?
Xcode was not downloading the provisioning profiles because it did not find any app id MATCHES. It did not find any matches because the capabilities in the "Certificates, Identifiers, Devices" website did not match the capabilities listed in the project in Xcode. Because the app identifier has In-App Purchase and Game Center enabled on the website but once I enabled it in the project it automatically downloaded the relevant provisioning profiles.
Hope this helps someone else.

Do i need a separate Distribution for each Apple AppStore submission?

I'm so confused -
after an entire day's struggle, i finally figured out how to submit my app to Apple via archiving & distributing from xcode.
... that was my free version
now i made my code changes, and on my pList file, i changed the Bundle Identifier to com.blah.mygame.pro instead of com.blah.mygame.lite
i also changed the Bundle name to be My Game Pro instead of My Game Lite
but now i'm confused - when i click on the project in Xcode, and i hit "Target" instead of "Project", i can't find my release/distribution profile! (my develop/debug profile) is still there.
if i were to click Project instead of Targets then i actually do see my previous distribution profile.
however, in my develloper portal, i had actually set my distribution profile to be linked up with the "com.blah.mygame.lite" identifier. was i not supposed to do this???
weirdly enough, when i made my distrubution profile earlier today, i say something like "mygame * -" or something that i coulda linked it to. but i just chose com.blah.mygame.lite without thinking
are you supposed to have multiple distribution profiles? one for every app? what i just want a lite and pro version?
** edit:
bonus points for this:
if i only needed 1 provisioning profile, (and since i messed up naming my previous provisioning profiles)... how do i rename all my distribution profiles without it interfering/messing up with my apps?? it's already submitted and awaiting approval
* EDIT # 2:
okay, i got both apps submitted with 2 separate distribution profiles.
however, is there any way that i can rename a distribution profiles while the app being submitted is still using it??
i had mistakenly named it "My Company Distribution Profile" when i should have named it "Distribution Profile for My Game Pro Version"
You have two options for fixing it:
Use a AppId like. com.blah.mygame.* . You can replace the * with any number of strings and use it for creating different application.
I won't recommend this approach, because the issue with this is you won’t be able to use push services or in-app purchases. You might not plan to use these services now, but if you change your mind, you won’t be able to change your app ID without creating a new app.
Create different AppId for different Apps. It'll be a good approach
Sounds like you're using a single AppID for both of your apps. You can only use one provisioning profile for multiple apps only if the AppID bound to that profile has a wildcard (e.g. "com.sample.*").
quoted from the iOS Provisioning Portal:
The Bundle Identifier portion of an App ID can be substituted with a
wild-card character (asterisk '*') so that a single App ID may be used
to build and install multiple applications. If the wild-card character
is not used, the Bundle Identifier portion of your App ID must be
input as your CF Bundle ID in Xcode to allow the application to
install on your device. The Bundle Seed ID portion of your App ID does
not need to be input into Xcode. Wild-card App IDs cannot be used with
the Push Notifications or for In-App Purchase.
I hope you have created an AppId with this bundle identifier com.blah.mygame.lite and created a distribution profile linked with this AppId. By doing like that, you can run or archive your apps only if it is having the same AppId like this com.blah.mygame.lite. If you want to create an AppId to run all apps, then you need a Wildcard AppId like this com.* . And If you think you need to run the app with AppId com.blah.mygame.pro then you need to create another appId like that and associate that appId with another distribution profile or modify the old one and download and install it and use.
There is no need of distribution profile for every app....one is enough for every time but
your bundle identifier is same as you given in your distribution provisioning profile when
you create it first time....

Resources