To allow user interaction, the Messaging Mobile SDK must be initiated. This API initializes the resources required by the SDK; all subsequent API calls. Except for the handlePushMessage, assume that the SDK has been initialized.
When the conversation screen is displayed, the server connection for messaging will be established. If a user session is already active and an additional SDK init call is made, it will be ignored and will not start an additional session. This method gets InitLivePersonProperties, which includes the properties needed for the init phase of the SDK.
public static void initialize (Context context, InitLivePersonProperties initProperties)
Parameter | Description |
---|---|
context | A context from the host app |
initProperties | An object with all the properties needed to initialize the SDK |
Since 5.26.0 version you are able to prefetch configuration data for your specific account. Use this method to initialize sdk and prefetch the data:
public static void initialize (Context context, InitLivePersonProperties initProperties, boolean shouldPreload)
Note: this method requires internet connection. If prefetch flow fails with any exception, then SDK's initialization will fail too. For existing methods the prefetch flow is disabled by default.
Note: if your account has configured vanity urls and certificate pinning keys, you can key-value pairs of domain-certificate key pairs to InitLivePersonProperties.