Initialization
Before the Data Cloud Module for the Engagement Mobile SDK can be used to invoke web services using the API, the SDK must be configured. Use the CdpConfigBuilder for iOS or CdpConfig.Builder for Android helper class to build your SDK configuration by providing required settings appId and endpoint that can be obtained from your Mobile Connector. Optionally, configuration can be provided for the settings trackScreens, trackLifecycle, and sessionTimeoutInSeconds.
Setting | Field Type | Description |
---|---|---|
appId | string | Required. The appId setting uniquely identifies your mobile application to Data Cloud and must be in a valid universally unique identifier, UUID, format. An invalid appID results in an error. |
endpoint | string | Required. The endpoint setting tells the SDK where to send the events being created and tracked. |
sessionTimeoutInSeconds | integer | The sessionTimeoutInSeconds setting represents the number of seconds the mobile application can remain in the background before the current session is expired. When a customer launches the mobile application, the SDK starts a new session that is maintained while the app is in the foreground. If the customer sends the mobile application to the background, the SDK starts a timer to expire the current session. If the customer brings the mobile app back to the foreground before the session expiration, the timer is cleared and the session is continued. Otherwise the session expires. This field is set to 600 by default. |
trackLifecycle | boolean | Enable trackLifecycle to automatically track AppForegrounded, AppBackgrounded, and AppVersionChanged behavior events. This field is set to false by default. |
trackScreens | boolean | Enable trackScreens to automatically track the mobile app ScreenEntry behavior event. This field is set to false by default. |
- (Optional) To capture debug information and track SDK initialization progress, set up logging before initializing the SDK. For iOS, use the
setLogger
method. For Android, use thesetLogging
method. For more information and example usage, see Logging and Debugging. - Configure the Data Cloud Module.
- Initialize the Engagement Mobile SDK with the Data Cloud Module.
Configuration happens during the initialization routine of the Mobile application being instrumented.