Java
Syntax
Copied to your clipboardpublic static void configureWithAppID(@NonNull final String appId);
Example
Copied to your clipboardMobileCore.configureWithAppId("1423ae38-8385-8963-8693-28375403491d");
Swift
Syntax
Copied to your clipboardstatic func configureWith(appId: String)
Example
Copied to your clipboardMobileCore.configureWith(appId: "1423ae38-8385-8963-8693-28375403491d")
Objective-C
Syntax
Copied to your clipboard+ (void) configureWithAppId: (NSString* appId);
Example
Copied to your clipboard[AEPMobileCore configureWithAppId: @"1423ae38-8385-8963-8693-28375403491d"];
Alternatively, you can also place the environment ID in your iOS project's Info.plist with the ADBMobileAppID
key. When the SDK is initialized, the environment ID is automatically read from the Info.plist file and the associated configuration.
Java
Syntax
Copied to your clipboardpublic static void updateConfiguration(@NonNull final Map<String, Object> configMap);
Example
Copied to your clipboardHashMap<String, Object> data = new HashMap<String, Object>();data.put("global.privacy", "optedout");MobileCore.updateConfiguration(data);
Swift
Syntax
Copied to your clipboard@objc(updateConfiguration:)static func updateConfigurationWith(configDict: [String: Any])
Example
Copied to your clipboardlet updatedConfig = ["global.privacy":"optedout"]MobileCore.updateConfigurationWith(configDict: updatedConfig)
Objective-C
Syntax
Copied to your clipboard+ (void) updateConfiguration: (NSDictionary* __nullable) config;
Example
Copied to your clipboardNSDictionary *updatedConfig = @{@"global.privacy":@"optedout"};[AEPMobileCore updateConfiguration:updatedConfig];
Java
Syntax
Copied to your clipboardpublic static void configureWithFileInPath(@NonNull final String filePath)
Example
Copied to your clipboard// Case 1: to use ADBMobileConfig.json in the assets folder// No code is needed// Case 2: to use a config json from a absolute path:MobileCore.configureWithFileInPath("absolute/path/to/exampleJSONfile.json");// Case 3: to use a config json in Assets folderMobileCore.configureWithFileInAssets("exampleJSONfile.json");
Swift
Syntax
Copied to your clipboardstatic func configureWith(filePath: String)
Example
Copied to your clipboardlet filePath = Bundle.main.path(forResource: "ExampleJSONFile", ofType: "json")if let filePath = filePath {MobileCore.configureWith(filePath: filePath)}
Objective-C
Syntax
Copied to your clipboard+ (void) configureWithFilePath: (NSString* __nullable) filepath;
Example
Copied to your clipboardNSString *filePath = [[NSBundle mainBundle] pathForResource:@"ExampleJSONFile" ofType:@"json"];[AEPMobileCore configureWithFilePath: filePath];