Configuration (MceConfig.json)
Overview
Configure the properties for your iOS and Android apps when you implement the Mobile SDK in the MceConfig.json properties file.
Config settings
Note:
Configure the SDK using the Swift application delegates to avoid the black screen when starting the app. For example, your value for the
appDelegateClass
for the sample app would be"SwiftSample.AppDelegate"
.
Settings ID | Value | Description |
---|---|---|
baseURL | The base URL for your pod. | When you configure the baseURL, you specify the value that is determined by your operating system and Pod. For a list of baseURLs for pods see the Setting a new baseURL section. |
appKey | Provide the development app keys and production app keys that were generated in Acoustic Campaign in the dev and prod fields. | Depending on how the app is compiled, the SDK can choose the correct app key to use. Do not change your app key after you publish your app. |
appDelegateClass | Replace AppDelegate with your AppDelegate class name. | For Swift apps, you must add the product name as a prefix to the appDelegate class name. Examples using the sample app that is included in the SDK Package:
Swift
appDelegateClass: "SwiftSample.AppDelegate"
Objective-C
appDelegateClass: "AppDelegate" |
logfile | True/false | Set to true to save your logs to a file for quick access to help with debugging. Set the UIFileSharingEnabled flag to YES in info.plist. This flag allows the file to be retrieved. Your logs are saved to the iTunes Sync section based on the name of the app. |
loglevel |
|
Provide a log level for debugging mode and production mode.
If you set the log level to:
|
maximumSize | The default value is 10MB | Maximum number of bytes for log files before they're rotated. |
maximumNumberOfLogFiles | The default value is 7 | Maximum number of rotated log files. |
maximumRadius | The default value is 2500000 | The maximum radius in meters to search for geofences. |
defaultRadius | The default value is 10000 | The default radius in meters within which the SDK starts to search for geofences. The SDK then extends the search up to the maximum radius if the search criteria can’t be satisfied. |
maximumCount | The default value is 100 | The maximum number of search attempts to find geofences. |
maximumQuantity | The default value is 20 | The maximum number of geofences that the SDK can find within the search radius. |
minimumQuantity | The default value is 1 | The minimum number of geofences that the SDK must find within the search radius. The SDK will keep searching for a certain time until the minimumQuantity is found. For example, if the minimumQuantity is 5 and the SDK finds only 4 geofences, it will keep searching until the time set. If the SDK does not find the minimum number of geofences set, it will report not finding any. Therefore, it is recommended to use the default setting of 1. |
Database configuration flags
Settings ID | Value | Description |
---|---|---|
databaseEncryption |
True/falseDefault value is false. | Use the flag to disable internal database encryption. This is typically only done for testing so the databases can be read in development. Note: If both the internal encrypted sqlite and the OS provided sqlite are linked on the same application, the internal database encryption will fail. We strongly recommend against rolling back from a version with encryption to a version without; this is likely to result in data loss. |
databaseKeyRotationDays |
The default value is 30. | Use this to change the frequency of key rotation for database encryption. |
allowJailbrokenDevices |
True/falseThe default value is true. | This flag can be used to disallow jailbroken devices from being able to register. |
{
"Please note: if you are using a Swift based Application Delegate you must include the product name and class name in AppDelegateClass, for example": "SwiftSample.AppDelegate",
"appDelegateClass": "AppDelegate",
"Please note": "you will need to update your baseUrl to the one supplied to you",
"baseUrl": "https://mobile-sdk-lib-XX-Y.brilliantcollector.com",
"appKey": {
"dev": "INSERT YOUR DEV APPKEY HERE",
"prod": "INSERT YOUR PROD APPKEY HERE"
},
"Please note, this option can be used to assign a device a different UserId on reinstallation, the default is to use the same UserId on reinstallation if possible (false). If you want a different UserId on reinstallation set invalidateExistingUser to": true,
"invalidateExistingUser": false,
"This flag can be used to prevent the SDK from reinitializing after a GDPR request has been processed if set to": false,
"autoReinitialize": true,
"Please note, the existince of the location key is not required, if it is not present though, iBeacon and Geofence support will be disabled.": "",
"location": {
"The location autoInitialize flag can be set to false to delay turning on the location services until desired.": "",
"autoInitialize": true,
"Please note, the existince of the location key will enable geofence location support, if geofence support is not desired, remove the key": "",
"geofence": {
"search": {
"maximumRadius": 2500000,
"defaultRadius": 10000,
"maximumCount": 100,
"maximumQuantity": 20,
"minimumQuantity": 1
},
"choose one of the following values for accuracy: ": [
"best",
"10m",
"100m",
"1km",
"3km"
],
"accuracy": "3km"
},
"The sync key is only used to customize the iBeacon and Geofence syncing sevice, it is not required for those features": "",
"sync": {
"Location Sync radius is in meters, default 100km": "",
"syncRadius": 100000,
"Specify how long to wait before syncing again on significant location change in seconds, default 5 minutes": "",
"syncInterval": 300
},
"Please note, the existince of the ibeacon key will enable iBeacon support, if iBeacon support is not desired, remove the key": "",
"ibeacon": {
"UUID": "INSERT-IBEACON-UUID-HERE"
}
},
"When the autoInitialize value is set to true it will start user registration immediately, if you want to trigger user registration later at a specific point in your app, set this value to": false,
"autoInitialize": true,
"The sessionTimeout value will set how long sessions last until a new one is reported on next app open in minutes": "",
"sessionTimeout": 20,
"Choose one of the following values for loglevel: ": [
"none",
"error",
"info",
"warn",
"verbose"
],
"loglevel": "error",
"Set logfile to true to write logs to the iTunes sync directory for debugging": "",
"logfile": true,
"Maximum size of log before it's rotated": "default is 10MB",
"maximumLogSize": 10000000,
"Maximum number of rotated log files": "default is to keep 7 in unix style rotation",
"maximumNumberOfLogFiles": 7,
"This flag can be used to disable internal database encryption, this is typically only done for testing so the databases can be read in development. Default value is ": false,
"databaseEncryption": false,
"This setting can be used to change the frequency of key rotation for database encryption. The default value is ": 30,
"databaseKeyRotationDays": 30,
"This flag can be used to disallow jailbroken devices from being able to register. The default value is ": true,
"allowJailbrokenDevices": true,
"watch": {
"category": "mce-watch-category",
"handoff": {
"Note the userActivityName must be also in the NSUserAcrtivityTypes array in the application's info.plist": "",
"userActivityName": "com.mce.application",
"This is the name of the interface controller in the Watch storyboard": "",
"interfaceController": "handoff"
}
}
}
Settings ID | Value | Description |
---|---|---|
baseURL | Required.The base URL for your Pod. | When you configure the baseURL, you specify the value that is determined by your operating system and Pod. For a list of baseURLs for pods on Android and iOS see the Setting a new baseURL section. |
appKey | Provide the development app keys and production app keys that were generated in Acoustic Campaign in the dev and prod fields. | Depending on how the app is compiled, the SDK can choose the correct app key to use. Do not change your app key after you publish your app. |
messagingService | fcm | Be sure to choose fcm and not gcm. |
Database configuration flags
Settings ID | Value | Description |
---|---|---|
impl | The class name for SDK implementation. | Use this class name to define the SDK database implementation. The default SDK database (android sqlite) will be set if this is not defined. |
encrypted | True/false The default value is false. |
Use this setting to define whether the SDK database will be encrypted. |
encryptionProvider | The class name for SDK encryption provider. | Use this classname to define the SDK encryption provider implementation. If this is not defined, the default SDK encryption provider (keystore-based for Android 18 and above and weak encryption for Android 17 and below) will be set. |
keyGenerator | The class name for SDK keyGenerator. | Use this class name to define the SDK database secret key generator implementation. The default SDK database secret key generator (random uuid) will be set if this is not defined. |
keyRotationIntervalInDays | The default value is 30, and the minimum value is 1. | Use this setting to define how many days to keep a database key before replacing it. |
{
"baseUrl": "https://mobile-sdk-lib-XX-Y.brilliantcollector.com",
"appKey": {
"prod": "YOUR APP KEY"
},
"Use 'gcm' for GCM of 'fcm' for FCM": "",
"messagingService": "fcm",
"Will invalidate the existing user/channel ID if they exist when set to true": "This is for testing only. Do not ship with this set to true unless you understand what you are doing",
"invalidateExistingUser": false,
"Setting sessionEnabled to true will trigger session start and session end events": "",
"sessionsEnabled": true,
"sessionTimeout is the number of minutes the SDK wait while the application is in the background before sending session end event": "",
"sessionTimeout": 20,
"metricTimeInterval defines the interval in minutes between SDK events sync with the server. This is only for events that are sent to the event queue": "",
"metricTimeInterval": 3,
"Set groupNotificationsByAttribution to true to bundle together notifications with the same attribution": "This will work on Android N and above",
"groupNotificationsByAttribution": false,
"Choose one of the following values for loglevel: ": [
"none",
"error",
"warn",
"info",
"debug",
"verbose"
],
"loglevel": "error",
"Please note, the log iteration files will be stored under": "/storage/self/Android/data/{app.bundle.id}/cache/ibm-mce-android-sdk/logs/<installation time folder, format: yyyy-MM-dd-HH-mm-ss>",
"logfile": false,
"The number of log iteration files": "After reaching this number, the log files will be overwritten in order",
"logIterations": 1,
"The number of hours each log iteration will hold": "0 is for infinite time",
"logIterationDurationInHours": 0,
"The number of log lines that will be stored in the ram before writing to the log file": "The higher this number is, more log lines will be lost in case of a crash.",
"logBufferSize": 10,
"Set useInMemoryImageCache to true to use RAM cache for inbox images": "",
"useInMemoryImageCache": true,
"Set useFileImageCache to true to use file based cache for inbox images": "Uses the sdcard application cache folder",
"useFileImageCache": true,
"The size of the inbox images RAM cache in MB": "",
"inMemoryImageCacheCapacityInMB": 20,
"The size of the inbox images file based cache in MB": "",
"fileImageCacheCapacityInMB": 100,
"location is only required if location support is needed. Please note that unlike iOS, location support is not enabled automatically. Enabling location support is done in the application code (see documentation).": "",
"location": {
"The sync key is only used to customize the iBeacon and Geofence syncing service, it is not required for those features": "",
"sync": {
"Specify how long to wait before syncing again on significant location change in seconds, default 5 minutes": "",
"syncInterval": 300,
"Location Sync radius is in meters, default 100km": "",
"syncRadius": 100000,
"Specify how long to wait before retrieving a new location from the device, default 5 minutes": "",
"locationResponsiveness": 300,
"Specify the minimum results when looking for locations nearby, default is 1, minimum value is 1": "",
"minLocationsForSearch": 1,
"Specify the maximum results when looking for locations nearby, default is 1, minimum value is 1": "",
"maxLocationsForSearch": 20,
"Specify the location providers that will be used to retrieve the device location. 'gps' - gps location. 'network' - wifi + cellular, default is gps + network": "",
"providerPreferences": [
"gps",
"network"
]
},
"Please note, unlike iOS, the existence of the ibeacon key does not enable iBeacon support, iBeacon support is enabled only if iBeacons are nearby": "",
"ibeacon": {
"Please note: if this is not set, iBeacon events will not be sent": "This value should never be empty. Leave the default value if you don't want to use iBeacons",
"uuid": "YOUR-IBEACONS-UUID",
"Specify how much time the sdk will scan for iBeacons in every scan session while the application is in the foreground, default is 5 seconds": "",
"beaconForegroundScanDuration": 5,
"Specify how much time the sdk will wait between iBeacons scan sessions while the application is in the foreground, default is 30 seconds": "",
"beaconForegroundScanInterval": 30,
"Specify how much time the sdk will scan for iBeacons in every scan session while the application is in the background, default is 30 seconds": "",
"beaconBackgroundScanDuration": 30,
"Specify how much time the sdk will wait between iBeacons scan sessions while the application is in the background, default is 5 minutes": "",
"beaconBackgroundScanInterval": 300
},
"This section is for database configuration": "",
"database": {
"This defines the sdk database implementation.": "If this is not defined, the default sdk database(android sqlite) will be set",
"impl": "co.acoustic.mobile.push.sdk.db.android.AndroidDatabaseImpl",
"This defines if the sdk database will be encrypted": "",
"encrypted": false,
"This defines the sdk encryption provider implementation.": "If this is not defined, the default sdk encryption provider (keystore based for Android 18 and above and weak encryption for Android 17 and below) will be set",
"encryptionProvider": "co.acoustic.mobile.push.sdk.encryption.DefaultSdkEncryptionProvider",
"This defines the sdk database secret key generator implementation.": "If this is not defined, the default sdk database secret key generator (random uuid) will be set",
"keyGenerator": "co.acoustic.mobile.push.sdk.db.DefaultSdkDatabaseSecretKeyGenerator",
"This defines how many days to keep a database key before replacing it": "minimum value is 1",
"keyRotationIntervalInDays": 30
}
}
}
Setting a new baseURL
Assign new MUIDs
Typically, the SDK remembers the MUID after the MUID has been assigned and starts the next time with the same MUID. This functionality can be inconvenient when testing.
The MceConfig.json file provides the non-sticky MUID option that lets you assign new MUIDs to devices when apps are uninstalled and then reinstalled.
To generate new UserIDs and ChannelIDs when an app is reinstalled, open the MceConfig.json configuration file and set invalidateExistingUser
to true
. If you set the flag to false
, then UserID
and ChannelId
do not change between reinstallations. The option is set to false
by default. Ensure that invalidateExistingUser
is false
before you ship your production app.
Updated 2 months ago