2

I'm configuring a iCloud KVStore scenery with multiple apps. In this scenery you have a primary app that writes to its kvstore container, and secondary apps that read from the primary app's kvstore. The primary apps has a kvstore identifier that by defaults (when activating the iCloud Key-Value Store Capability) is

<key>com.apple.developer.icloud-container-identifiers</key>
    <array/>
    <key>com.apple.developer.ubiquity-kvstore-identifier</key>
    <string>$(TeamIdentifierPrefix)$(CFBundleIdentifier)</string>

As described by the common key-value store scenery for multiple apps in Apple's Doc:

Configuring Common Key-Value Storage for Multiple Apps

You have to specify for all the apps but the primary, the kv-store identifier of the primary, so like

<key>com.apple.developer.icloud-container-identifiers</key>
    <array/>
    <key>com.apple.developer.ubiquity-kvstore-identifier</key>
    <string>ABCDEFGH.com.myCompany.myApp</string>

where

ABCDEFGH.com.myCompany.myApp is the $(TeamIdentifierPrefix)$(CFBundleIdentifier) values.

While running the secondary app (that is a tvOS app in this case) it works if it has a default kv-store identifier, it does not run (it compiles), when using the requested ABCDEFGH.com.myCompany.myApp value, used to read the shared iCloud KVStore

The error is:

The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016).

I have also tried to check the Team-ID identifier's value, programmatically to be sure that is the one defined on the iTunesConnect portal like this:

+ (NSString *)bundleSeedID {
    NSDictionary *query = [NSDictionary dictionaryWithObjectsAndKeys:
                           (__bridge NSString *)kSecClassGenericPassword, (__bridge NSString *)kSecClass,
                           @"bundleSeedID", kSecAttrAccount,
                           @"", kSecAttrService,
                           (id)kCFBooleanTrue, kSecReturnAttributes,
                           nil];
    CFDictionaryRef result = nil;
    OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);
    if (status == errSecItemNotFound)
    status = SecItemAdd((__bridge CFDictionaryRef)query, (CFTypeRef *)&result);
    if (status != errSecSuccess)
    return nil;
    NSString *accessGroup = [(__bridge NSDictionary *)result objectForKey:(__bridge NSString *)kSecAttrAccessGroup];
    NSArray *components = [accessGroup componentsSeparatedByString:@"."];
    NSString *bundleSeedID = [[components objectEnumerator] nextObject];
    CFRelease(result);
    return bundleSeedID;
}

and in fact it is the right one:

ABCDEFGH.com.myCompany.myApp

I have tried an app that is on the AppStore already, and an app that is in development, but configured on the AppStore (so BundleID, Provisioning Profiles by this BundleID, all comes from iTunes Connect) but, the error stays on.

loretoparisi
  • 12,864
  • 9
  • 78
  • 108

0 Answers0