-
Notifications
You must be signed in to change notification settings - Fork 20
Shared Hardware Id
From 2.7.0 Emarsys SDK provides a solution to share the hardware identifier between your applications, that has Emarsys SDK integrated.
For this to work, some additional steps are required.
Note
Please pay extra attention to having your application's private access group (probably your bundleId) as the first entry in the accessGroups list, as Apple will default to the first item in the list whenever no accessGroup is used while using the keychain. This is very important because misconfiguration of this part can cause data loss in the EmarsysSDK.
To learn more about
Keychain sharing
read the official Apple article about the topic
setSharedKeychainAccessGroup
should be called with the chosen shared keyhchain access group, which was previously set up in XCode, prefixed by your teamId (you can look it up on apple developer site under Certificates, Identifiers & Profiles -> Identifiers -> App Id prefix eg: "XXXXXXXXX.com.emarsys.Shared")
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
EMSConfig *config = [EMSConfig makeWithBuilder:^(EMSConfigBuilder *builder) {
[builder setMobileEngageApplicationCode:<applicationCode: NSString>];
[builder setMerchantId:<merchantId: NSString>];
[builder setSharedKeychainAccessGroup:<sharedKeychainAccessGroup: NSString>];
}];
[Emarsys setupWithConfig:config];
return YES;
}
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let config = EMSConfig.make { builder in
builder.setMobileEngageApplicationCode(<applicationCode: String>)
builder.setMerchantId(<merchantId: String>)
builder.sharedKeychainAccessGroup(<sharedKeychainAccessGroup: String>)
}
Emarsys.setup(with: config)
return true
}