SDK Lifecycle
Synerise Builder
Synerise builder class.
Declared In:
com.synerise.sdk.core.Synerise.Builder
Declaration:
public static class Builder
Properties:
Property | Type | Optional | Default | Description |
---|---|---|---|---|
app | Application | no | - | Application context |
apiKey | String | no | - | Profile API Key (formerly Client). Can be retrieved from Synerise App |
applicationId | String | no | - | Application ID |
baseUrl | String | no | - | Base URL in the SDK. Can be null |
syneriseDebugMode | Boolean | no | - | Debug mode flag |
notificationIcon | int | no | R.drawable.synerise_ic_default_icon | Notification icon |
notificationIconColor | int | no | R.color.syneriseGrayTranslucent | Notification color |
channelDefaultName | String | no | - | Default notification channel name |
channelDefaultId | String | no | - | Default notification channel ID |
channelHighPriorityName | String | no | - | High priority notification channel name |
channelHighPriorityId | String | no | - | High priority notification channel ID |
pushListener | OnRegisterForPushListener | no | - | Push listener |
locationListener | OnLocationUpdateListener | no | - | Location listener |
crashHandlingEnabled | Boolean | no | - | Crash handling flag |
hostApplicationType | HostApplicationType | yes | - | Host application type |
hostApplicationSDKPluginVersion | String | yes | - | Synerise SDK plugin version in the host application |
setRequestValidationSalt | String | yes | - | Synerise Profile salt string for request validation |
messagingServiceType | String | yes | GMS | Use GMS for Google Mobile Services or HMS for Huawei Mobile Services |
Initializers:
Start initializing Synerise SDK with this method.
To get the Workspace API Key (formerly Business) and Profile API Key (formerly Client), sign in to your Synerise account and go to Settings > API Key.
Then, copy or generate a new API Key for the workspace and API Key for profiles.
public static Builder with(Application app, String apiKey, String appId)
Use this method to finish the initialization process.
public void build()
Methods:
This method sets the icon that will be used as the small icon in notifications.
It must be a drawable resource (not a mipmap) due to Android Oreo adaptive icons restrictions.
public Builder notificationIcon(@DrawableRes int notificationIcon)
This method sets the notification icon and text color.
notificationIconColor
must be in ARGB format.
public Builder notificationIconColor(int notificationIconColor)
This method enables/disables logcat logs from Synerise SDK.
It is not recommended to use debug mode in the release version of your application.
public Builder syneriseDebugMode(boolean syneriseDebugMode)
This method passes info about Users application crashes as dedicated events to the backend.
It is recommended to use SyneriseCrashHandling
.
public Builder crashHandlingEnabled(boolean exceptionHandlerEnabled)
It is important to register your profiles for push messages, so Synerise SDK may ask you to register a profile for push notifications.
This callback is called after the profile signs in, signs up, or deletes the account.
public Builder pushRegistrationRequired(@NonNull OnRegisterForPushListener listener)
This callback is called on demand by push notification, so it may be called at any time.
Check out the sample application for example usage and remember to send.
public Builder locationUpdateRequired(@NonNull OnLocationUpdateListener listener)
You can provide your custom base URL to use your own API.
You can use one of the constants:
SyneriseApiUrls.SYNERISE_AZ_API_URL - https://api.snrapi.com
SyneriseApiUrls.SYNERISE_AZU_API_URL - https://api.azu.snrapi.com
SyneriseApiUrls.SYNERISE_GEB_API_URL - https://api.geb.snrapi.com
public Builder baseUrl(String baseUrl)
You can provide your notification channel name.
By default, the channel name is set to your application name.
public Builder notificationDefaultChannelName(@NonNull String name)
You can provide your notification channel ID.
public Builder notificationDefaultChannelId(@NonNull String channelId)
You can provide your High Priority notification channel name.
From default, channel name is set to <your application name> High Priority
public Builder notificationHighPriorityChannelName(@NonNull String name)
You can provide your High Priority notification channel ID.
public Builder notificationHighPriorityChannelId(@NonNull String channelId)
You can set the Synerise SDK host application type.
public Builder hostApplicationType(HostApplicationType type)
You can set Synerise the SDK plugin version of the host application.
public Builder hostApplicationSDKPluginVersion(@NonNull String version)
InitializationConfig
Configuration class for initialization of the SDK.
Declared In:
com.synerise.sdk.core.types.model.InitializationConfig
Declaration:
public class InitializationConfig
Properties:
Property | Type | Optional | Default | Description |
---|---|---|---|---|
salt | String | no | - | Simple Profile Authentication salt |
Methods:
There are getters and setters for the above properties.
Settings
Class model for settings.
Declared In:
com.synerise.sdk.core.settings.Settings
Declaration:
public class Settings
Properties:
Property | Type | Description |
---|---|---|
sdk | GeneralSettings | General settings - This group contains options related to the general functioning of mobile SDK |
notifications | NotificationsSettings | Notifications settings - This group contains options related to push notifications |
tracker | TrackerSettings | Tracker - This group contains options related to tracking the customer activities in a mobile application |
inAppMessaging | InAppMessagingSettings | In-app messaging - This group contains options related to the in-app messages feature |
injector | InjectorSettings | Injector - This group contains options related to displaying campaigns |
Note:
Learn more about settings here
TrackMode
This enum contains the values which set a mode for tracking component interactions from the android.widget
package.
Declared In:
com.synerise.sdk.core.types.enums.TrackMode
Declaration:
public enum TrackMode
Values:
Property | Description |
---|---|
PLAIN | Tracks screen-visits. Events are sent when onStart of activities/Fragments is called. |
FINE | Tracks screen-visits and onClick events from components such as Buttons, ImageButtons, RatingBars |
Methods:
There are no methods.