Is there way to create bundle identifier without the corresponding app with Fastlane? - fastlane

I'm using produce to create my app on App Store Connect. It works well but it seems that the command does not allow creating bundle identifier without an associated app.
I just want to create extra bundle ids that I will use later for ad hoc distribution on Microsoft AppCenter.
Is there a way to do that with produce or any fastlane plugins?
The only way I found is using the App Store Connect web interface or this REST endpoint:
https://developer.apple.com/documentation/appstoreconnectapi/register_a_new_bundle_id

I finally managed to create those bundle ids using Spaceship
(https://github.com/fastlane/fastlane/blob/master/spaceship/docs/AppStoreConnect.md#bundle-id-auth-key)

Related

can we install multiple application using single wildcard App ID in iPhone?

I have create three developer profile (like A,B,C) with wildcard APP ID.
First, I have install application A using profile A in device.
Now, I have install application B using profile B in device, then this B application is overwrite on application A. means now application A is not available in device only B application is available.
Same issue generate when we use C profile.
So, only one application is install in device at a time that's my problem.
so. pls tell me how to install more than one application in device without generated different APP ID(means using wildcard APP ID).
It seems that all of your apps are using the same bundle identifier (specified in the app's info.plist file)..
The idea is:
each app has got its own unique identifier;
a (*) wildcard profile will just work with any identifier.
A bundle identifier has the generic form:
domain.name.appName
e.g.
com.apple.iphoto
I would suggest checking how those values are defined in your apps.

Keychain group access to share data between my existing applications

I have many iOS applications live on AppStore. Now for next version of apps, I want to keep a piece of data for every application to share in KeyChain. As far as I know I need to provide same Keychain access group in Apple's KeychainItemWrapper class.
*keychain = [[KeychainItemWrapper alloc] initWithIdentifier:#"Any string" accessGroup:<string representing access group>];
I know about custom URLs and it is of no use as I want data to be persistent.
All my applications have different bundle seed ID as I can see from provisioning portal. I know that the main pre-requisite for shared keychain access is that all of the applications have a common bundle seed ID.
Now my question is how do I make sure that in this senario I can use Keychain to share data among all these applications ?
Is it possible to change the bundle seed ID of all applications through Provisioning profile portal without doing any harm to any functionality ( Although I want to avoid that as there are so many apps).
Is there a way I can add bundle seed ID of all apps in a file and build all apps with that file in project to achieve this ? I know about "keychain-access-groups", do i need to create a plist file and add bundle seed ID of all application in it ?
Appreciate any help in this regard.
If you have different bundle seed IDs (the ten alphanumeric characters preceding the bundle identifier, the Xs in XXXXXXXXXX.com.company.application), you can't share an access group. It's a restriction on Apple's part and circumventing it is not allowed. I suggest you find another solution of safely sharing data (possibly outside of the device, on a server, but not iCloud as it has the same restrictions).
General information about keychain access groups:
Since iPhone OS 3.0 it has been possible to share data between a family of applications. This can provide a better user experience if you follow the common path of free/premium applications or if you have a set of related applications that need to share some common account settings.
The main pre-requisite for shared keychain access is that all of the applications have a common bundle seed ID. To be clear what this means remember that an App ID consists of two parts:
<Bundle Seed ID> . <Bundle Identifier>
The bundle seed ID is a unique (within the App Store) ten character string that is generated by Apple when you first create an App ID. The bundle identifier is generally set to be a reverse domain name string identifying your app (e.g. com.yourcompany.appName) and is what you specify in the application Info.plist file in Xcode.
So when you want to create an app that can share keychain access with an existing app you need to make sure that you use the bundle seed ID of the existing app. You do this when you create the new App ID in the iPhone Provisioning Portal. Instead of generating a new value you select the existing value from the list of all your previous bundle seed IDs.
One caveat, whilst you can create a provisioning profile with a wildcard for the bundle identifier I have never been able to get shared keychain access working between apps using it. It works fine with fully specified (no wildcard) identifiers. Since a number of other Apple services such as push notifications and in-app purchase also have this restriction maybe it should not be a surprise but I am yet to find this documented for keychain access.
Once you have your provisioning profiles setup with a common bundle seed ID the rest is pretty easy. The first thing you need to do is register the keychain access group you want to use. The keychain access group can be named pretty much anything you want as long as it starts with the bundle seed ID. So for example if I have two applications as follows:
ABC1234DEF.com.useyourloaf.amazingApp1
ABC1234DEF.com.useyourloaf.amazingApp2
I could define a common keychain access group as follows:
ABC1234DEF.amazingAppFamily
To enable the application to access this group you need to add an entitlements plist file to the project using xCode. Use Add -> New File and select the Entitlements template from the iPhone OS Code Signing section. You can name the file anything you like (e.g. KeychainAccessGroups.plist). In the file add a new array item named keychain-access-groups and create an item in the array with the value of our chosen keychain access group:
Note: Do not change the get-task-allow item that is created by default in the entitlements file unless you are creating an Ad-Hoc distribution of your app (in which case you should uncheck this option).
This same process should be repeated for all apps that share the bundle seed ID to enable them to access the keychain group. To actually store and retrieve values from this group requires adding an additional value to the dictionary passed as an argument to the keychain services. Using the example from the previous post on simple iPhone keychain access the search dictionary gets the following additional item:
[searchDictionary setObject: #"ABC1234DEF.amazingAppFamily" forKey: (id)kSecAttrAccessGroup];
One final comment, using a shared keychain access group does not stop you from storing values in an applications private keychain as well. The Apple GenericKeychain example application builds two applications which both store data in a private and group keychain.
Source: Use Your Loaf
Now you can use UIPasteboard
//First app, install->run->close->delete
UIPasteboard* board = [UIPasteboard pasteboardWithName:#"com.company.wtv" create:YES];
board.persistent=YES;// persistent to make what you write persist after your app closes, or gets deleted.
[board setValue:#"ccccc" forPasteboardType:#"com.company.wtv.sharedValue"];
//Second app, installed after first one is deleted and ran this one... While bundle identifier and bundle seed different (i tried it on adhoc, not really releasing the app, but i htink the same)
NSData* result=nil;
NSString*resultStr=nil;
result =[board valueForPasteboardType:#"com.company.wtv.sharedValue"];
resultStr=[[NSString alloc] initWithData:result encoding:NSUTF8StringEncoding];// I got resultStr containing ccccc
check UIPasteboard documentation for further info.
I'll be coming back after using this for my store apps, in case of troubles
You can't change your app's bundle ID after it has been put into the AppStore. You also can't make an app read the info from the keychain that was put there by another app (with a different bundle ID). The solution: you'll need an entitlement with which you can access practically all the data.

Manage iOS Enterprise Developer Program

We recently enrolled in the iOS Enterprise Developer Program to be able to use in-house distribution, which significantly simplifies the deployment of the apps inside our company which is fairly big. Before joining we have thoroughly read the program documentation and we were aware that the new account would live completely separated from the standard account we use for the AppStore submissions.
What I'm unsure about is now what would be the best way to organize the two accounts in the developer portals. I'm mostly concerned with the bundle identifier since I'll be dealing with two different bundle ids inside Xcode for each application. All of our apps use iCloud and Push notifications so wildcard is not an option.
How do you organize this inside Xcode? Do you create two different targets or are you able to manage this with a new Project Configuration? What about iCloud entitlements?
EDIT
Just as an update I wanted to make clear that we're looking for the best solution to build an app for both In-House distribution and for AppStore submission.
EDIT2
Given that the enterprise program does not grant you access to iTunesConnect, where test users and product ids can be setup, is there really no way to test InApp purchases?
I'm not entirely clear on what you need, but it sounds like you want to be able to build your app store apps for internal enterprise use. Is that correct?
If you want to be able to build your app with two different bundle IDs you can create a custom build setting, and give it different values for your different configurations.
So for example, you could create your Enterprise configuration:
Then go to your target's build settings and add a user-defined build setting:
Give it a name like BUNDLE_ID, and if you expand the triangle you can give it different values for each configuration:
Next, open your Info.plist file and enter ${BUNDLE_ID} for the bundle id value:
When you compile using the "Enterprise" configuration, which you can do using a custom scheme (or via the command line build process if that's what you use), the appropriate bundle id will be used.
You can also configure the code signing/provisiong profile setting in the same way:
Once you do this, the correct push notification/iCloud entitlements will be used depending on the configuration.
We've been doing this kind of thing for a long time now. Our build server will generate enterprise and app store versions of our apps for each build, using exactly this technique.
When it comes to the provisioning portal, you will need to configure both app IDs separately for push notifications, iCloud, etc.
This does mean that push notifications must be sent separately to the app store and enterprise versions since they will not share the same bundle ID or push notification certificate.
The iCloud storage by default will be totally separate for the two versions. They may be able to access the same iCloud store (if you need this) as long as the entitlements are set up with the same team ID. But this may be a problem if you have two separate developer accounts.

iPhone/iTunes Connect - Is it possible to automatically create an app and fill in metadata for it?

I am wondering if it is possible to automatically do the following regarding the iphone app store and itunes connect:
Create an app id and bundle id.
Create provisioning profiles.
Create an app in iTunes connect and edit its metadata.
Upload screenshots and icons to an app.
I understand there is no API but is there any other alternative to doing this automatically? or at least doing one of these?
No, there is no other way to do it. Now with more recent XCode version, you can upload your application binary directly from XCode (no need to go on itunesconnect). But all other steps you mentioned still need to be done manually.

iPhone: determine distribution type programmatically for testing

At runtime in an iPhone app, is there a way to distinguish the distribution type programmatically between ad hoc and app store? Whenever I do an ad hoc distribution I want to target internal test servers for web service end points, then for the app store distribution target the production servers.
You can. Open the file embedded.mobileprovision file in your application bundle (you can do this programatically, of course) and check for <key>ProvisionedDevices</key>. It's only there in the Ad Hoc copy of your app, as long as you did sign the App Store version with an App Store provisioning profile.
I don't think that info is available to your app. But you could do this by using different preprocessor #defines for the different Build configs and then define your constants based on the values of these #defines.
I don't think there is a way to determine the distribution type as they would just be the same binary but supplied a different way. I would make a separate build for your ad hoc and change what you need to point it to your internal test servers.