Modules

Synerise

Main Synerise module responsible for whole SDK. This class is responsible for initialization of SDK.

Declared In:
com.synerise.sdk.core.Synerise

Declaration:

public class Synerise

Properties:

Property Type Optional Default Description
settings Settings no - Configuration of whole SDK

Initializers:

There is a builder.

Methods:

Method to get applicationContext.

public static Context getApplicationContext()


Method that generates the document assigned to a slug.

public static String getClientApiKey()


Get application ID.

public static String getAppId()


Get base URL.

public static String getBaseUrl()


Get flag indicating debugMode state.

public static boolean getSyneriseDebugMode()




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
clientApiKey String no - Client apiKey. Can be retrieved from app.synerise.com
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

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 clientApiKey, 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.
For example, Synerise base URL is https://api.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)



Client

Module responsible for all operations connected with a profile (formerly client).

Declared In:
com.synerise.sdk.client.Client

Declaration:

public abstract class Client

Properties:

There are no properties.

Initializers:

There are no initializers.

Methods:

This method sets ClientStateChangeListener to get optional callbacks.

public static void setOnClientStateChangeListener(OnClientStateChangeListener listener)
(Click for more details)


This method removes ClientStateChangeListener.

public static void removeClientStateChangeListener()
(Click for more details)


This method changes a Profile (formerly Client) API key dynamically.

public static void changeApiKey(@NonNull String apiKey)
(Click for more details)


This method registers a new customer with an email, password, and optional data.

public static IApiCall registerAccount(@NonNull RegisterClient registerClient)
(Click for more details)


This method confirms a customer account with the confirmation token.

public static IApiCall confirmAccount(String token)
(Click for more details)


This method activates a customer with email.

public static IApiCall activateAccount(String email)
(Click for more details)


This method requests a customer’s account registration process with the PIN code.

public static IApiCall requestAccountActivationByPin(String email)
(Click for more details)


This method confirms a customer’s account registration process with the PIN code.

public static IApiCall confirmAccountActivationByPin(String pinCode, String email)
(Click for more details)


This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.

public static IApiCall signIn(@NonNull String email, @NonNull String password)
(Click for more details)


This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.

public static IDataApiCall<AuthConditions> signInConditionally(@NonNull String email, @NonNull String password)
(Click for more details)


This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.

public static IApiCall authenticate(@NonNull String token, @NonNull ClientIdentityProvider provider, @Nullable Agreements agreements, @Nullable Attributes attributes, @Nullable String authId)
(Click for more details)


This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.

public static IDataApiCall<AuthConditions> authenticateConditionally(@NonNull String token, @NonNull ClientIdentityProvider provider, @Nullable Agreements agreements, @Nullable Attributes attributes, @Nullable String authId)
(Click for more details)


This method authenticates a customer with OAuth.

public static IApiCall authenticateByOAuth(@NonNull String accessToken, @Nullable Agreements agreements, @Nullable Attributes attributes, @Nullable String authId)
(Click for more details) - DEPRECATED


This method authenticates a customer with OAuth.

public static IApiCall authenticateByOAuthIfRegistered(@NonNull String accessToken, @Nullable String authId)
(Click for more details) - DEPRECATED


This method authenticates a customer with Facebook.

public static IApiCall authenticateByFacebook(@NonNull String facebookToken, @Nullable Agreements agreements, @Nullable Attributes attributes, @Nullable String authId)
(Click for more details) - DEPRECATED


This method authenticates a customer with Facebook.

public static IApiCall authenticateByFacebookIfRegistered(@NonNull String facebookToken, @Nullable String authId)
(Click for more details) - DEPRECATED


Signs in a customer in with the provided token payload.

public static IApiCall authenticateWithTokenPayload(TokenPayload tokenPayload, @NonNull String authId) 
(Click for more details)


This method authenticates a customer with Simple Authentication.

public static IApiCall simpleAuthentication(ClientData clientData, String authId)
(Click for more details)


This method checks if a customer is signed in (via RaaS, OAuth, Facebook, Apple).

public static boolean isSignedIn()
(Click for more details)


This method checks if a customer is signed in (via Simple Authentication).

public static boolean isSignedInViaSimpleAuthentication()
(Click for more details)


This method signs out a customer out.

public static void signOut()
(Click for more details)


This method signs out a customer out with a chosen mode.

public static void signOut(ClientSignOutMode mode)
(Click for more details) - DEPRECATED in version 5.1.0


This method signs out a customer out with a chosen mode and Determines if the method should sign out all devices

public static IApiCall signOut(ClientSignOutMode mode, Boolean signOutFromAllDevices)
(Click for more details)


This method refreshes the customer’s current token.

public static IApiCall refreshToken()
(Click for more details)


This method retrieves the customer’s current, active token.

public static IDataApiCall<Token> getToken()
	[(Click for more details)](/developers/mobile-sdk/method-reference/android/client-session/#get-customer-token)
(Click for more details)


This method retrieves the customer’s current UUID.

public static String getUuid()
(Click for more details)


Retrieves the current UUID or generates a new one from a seed.

public static String getUuidForAuthentication(@NonNull String authId) 
(Click for more details)


This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.

public static boolean regenerateUuid()
(Click for more details)


This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.

public static boolean regenerateUuid(String clientIdentifier)
(Click for more details)


This method destroys the session completely.

public static void destroySession()
(Click for more details)


This method gets a customer’s account information.

public static IDataApiCall<GetAccountInformation> getAccount()
(Click for more details)


This method retrieves events for an authenticated customer.

public static IDataApiCall<List<ClientEventData>> getEvents(ClientEventsQuery clientEventsQuery)
(Click for more details)


This method updates a customer’s account information.

public static IApiCall updateAccount(@NonNull UpdateAccountInformation accountInformation)
(Click for more details)


This method requests a customer’s password reset with email.

public static IApiCall requestPasswordReset(@NonNull PasswordResetRequest resetRequest)
(Click for more details)


This method confirm a customer’s password reset with the new password and token provided by password reset request.

public static IApiCall confirmPasswordReset(@NonNull PasswordResetConfirmation resetConfirmation)
(Click for more details)


This method changes a customer’s password.

public static IApiCall changePassword(@NonNull String oldPassword, @NonNull String password)
(Click for more details)


This method requests a customer’s email change.

public static IApiCall requestEmailChangeByFacebook(String email, @Nullable String uuid)
(Click for more details)


This method confirms an email change.

public static IApiCall confirmEmailChange(String token, boolean newsletterAgreement)
(Click for more details)


Requests a customer’s phone update. A confirmation code is sent to the phone number.

public static IApiCall requestPhoneUpdate(String phone)
(Click for more details)


This method confirms a phone number update. This action requires the new phone number and confirmation code as parameters.

public static IApiCall confirmPhoneUpdate(String phone, String confirmationCode, @Nullable Boolean smsAgreement)
(Click for more details)


This method deletes a customer’s account.

public static IApiCall deleteAccount(String clientAuthFactor, ClientIdentityProvider clientIdentityProvider, @Nullable String authId)
(Click for more details)


This method deletes a customer’s account.

public static IApiCall deleteAccount(String password)
(Click for more details) - DEPRECATED


This method deletes a customer’s account by OAuth.

public static IApiCall deleteAccountByOAuth(String accessToken, @Nullable String uuid)
(Click for more details) - DEPRECATED


This method deletes a customer’s account by Facebook.

public static IApiCall deleteAccountByFacebook(String facebookToken, @Nullable String uuid)
(Click for more details) - DEPRECATED


This method passes the Firebase Token to Synerise for notifications and doesn’t update the agreement of the profile.

public static IApiCall registerForPush(@NonNull String firebaseId)
(Click for more details)


This method passes the Firebase Token to Synerise for notifications.

public static IApiCall registerForPush(@NonNull String firebaseId, boolean mobilePushAgreement)
(Click for more details)




Tracker

Module responsible for sending events.

Declared In:
com.synerise.sdk.event.Tracker

Declaration:

public abstract class Tracker

Properties:

There are no properties.

Initializers:

There are no initializers.

Methods:

This method sets a custom identifier in the parameters of every event.

public static void setCustomIdentifier(String customIdentifier)
(Click for more details)


This method sets a custom email in the parameters of every event.

public static void setCustomEmail(String customEmail)
(Click for more details)


This method sends an event.

public static void send(Event event)
(Click for more details)


This method forces sending the events from the queue to the server.

public static void flush()
(Click for more details)




Injector

Module responsible for handling push notifications.

Declared In:
com.synerise.sdk.injector.Injector

Declaration:

public abstract class Injector

Properties:

There are no properties.

Initializers:

There are no initializers.

Methods:

This method handles a notification payload and starts activity.

public static boolean handlePushPayload(Bundle bundle)
public static boolean handlePushPayload(Map<String, String> pushPayload)
(Click for more details)


This method decrypts the notification payload.

public static Map<String, String> decryptPushPayload(Map<String, String> pushPayload) throws DecryptionException
(Click for more details)


This method verifies if a notification is encrypted.

public static boolean isPushEncrypted(Map<String, String> pushPayload)
(Click for more details)


This method verifies if a notification was sent by Synerise.

public static boolean isSynerisePush(Map<String, String> pushPayload)
(Click for more details)


This method verifies if a notification’s sender is Synerise and if the notification is a Silent Command.

public static boolean isSilentCommand(Map<String, String> pushPayload)
(Click for more details)


This method verifies if a notification’s sender is Synerise and if the notification is a Silent SDK Command.

public static boolean isSilentCommandSdk(Map<String, String> pushPayload)
(Click for more details)


This method verifies if a notification’s sender is Synerise and if the notification is a Simple Push campaign

public static boolean isSyneriseSimplePush(Map<String, String> pushPayload)
(Click for more details)


This method verifies if a notification’s sender is Synerise and if the notification is a Banner campaign.

public static boolean isSyneriseBanner(Map<String, String> pushPayload)
(Click for more details)


This method converts push payload into SilentCommand object.

public static SilentCommand getSilentCommand(Map<String, String> payload) throws ValidationException
(Click for more details)


This method fetches a walkthrough.

public static void getWalkthrough()
(Click for more details)


This method shows a walkthrough when it is loaded.

public static boolean showWalkthrough()
(Click for more details)


This method checks if a walkthrough is loaded.

public static boolean isWalkthroughLoaded()
(Click for more details)


This method checks if the walkthrough is unique compared to the previous one.

public static boolean isLoadedWalkthroughUnique()
(Click for more details)


This method sets your own Walkthrough listener to receive optional callbacks.

public static void setOnWalkthroughListener(OnWalkthroughListener listener)
(Click for more details)


This method sets your own Walkthrough listener to receive optional callbacks.

public static void removeWalkthroughListener()
(Click for more details)


This method fetches banners set for mobile campaigns and caches the valid ones.

public static void fetchBanners()
public static void fetchBanners(@NonNull final DataActionListener<List<TemplateBanner>> successListener,
                                    @NonNull final DataActionListener<ApiError> errorListener)
(Click for more details)


This method provides valid banners directly from SDK cache.

public static List<TemplateBanner> getBanners()
(Click for more details)


This method shows a banner immediately.

public static void showBanner(TemplateBanner banner, boolean markPresented)
(Click for more details)


This method sets Banner listener to receive optional callbacks.

public static void setOnBannerListener(OnBannerListener listener)
(Click for more details)


This method removes Banner listener to stop receiving callbacks.

public static void removeBannerListener()
(Click for more details)


This method fetches Push Notifications set for mobile campaigns.

public static IDataApiCall<List<SynerisePushResponse>> getPushes()
(Click for more details)




Promotions

Module responsible for managing promotions.

Declared In:
com.synerise.sdk.promotions.Promotions

Declaration:

public abstract class Promotions

Properties:

There are no properties.

Initializers:

There are no initializers.

Methods:

This method retrieves all available promotions that are defined for a customer.

public static IDataApiCall<PromotionResponse> getPromotions()
(Click for more details)


This method retrieves all available promotions that are defined for a customer.

public static IDataApiCall<PromotionResponse> getPromotions(PromotionsApiQuery promotionsApiQuery)
(Click for more details)


This method retrieves the promotion with the specified UUID.

public static IDataApiCall<SinglePromotionResponse> getPromotionByUuid(@NonNull String uuid)
(Click for more details)


This method retrieves the promotion with the specified code.

public static IDataApiCall<SinglePromotionResponse> getPromotionByCode(@NonNull String code)
(Click for more details)


This method activates the promotion with the specified UUID.

public static IApiCall activatePromotionByUuid(@NonNull String uuid)
(Click for more details)


This method activates the promotion with the specified code.

public static IApiCall activatePromotionByCode(@NonNull String code)
(Click for more details)


This method deactivates the promotion with the specified UUID.

public static IApiCall deactivatePromotionByUuid(@NonNull String uuid)
(Click for more details)


This method deactivates the promotion with the specified code.

public static IApiCall deactivatePromotionByCode(@NonNull String code)
(Click for more details)


This method retrieves an assigned voucher code or assigns a voucher from a pool identified by UUID to the profile.

When the voucher is assigned for the first time, a voucherCode.assigned event is produced.

public static IDataApiCall<AssignVoucherResponse> getOrAssignVoucher(@NonNull String poolUuid)
(Click for more details)


This method assigns a voucher from a pool identified by UUID to the profile.

A voucherCode.assigned event is produced.

public static IDataApiCall<AssignVoucherResponse> assignVoucherCode(@NonNull String poolUuid)
(Click for more details)


This method retrieves voucher codes for a customer.

public static IDataApiCall<VoucherCodesResponse> getAssignedVoucherCodes()
(Click for more details)




Content

Module responsible for managing documents, reccommendations and content widget.

Declared In:
com.synerise.sdk.content.Content

Declaration:

public abstract class Content

Properties:

There are no properties.

Initializers:

There are no initializers.

Methods:

This method generates the document assigned to a slug.

public static IDataApiCall<Object> getDocument(String slugName)
(Click for more details) - DEPRECATED in version 5.5.0


This method generates the document that is defined for the provided slug.

public static IDataApiCall<Document> generateDocument(String slugName)
(Click for more details)


This method generates documents that are defined for parameters provided in the query object.

public static IDataApiCall<List<Object>> getDocuments(DocumentsApiQuery documentsApiQuery)
(Click for more details) - DEPRECATED in version 5.5.0


This method generates recommendations that are defined for the options provided.

public static IDataApiCall<RecommendationResponse> getRecommendations(String slugName, RecommendationRequestBody options)
(Click for more details) - DEPRECATED in version 5.5.0


This method generates recommendations that are defined for the options provided.

public static IDataApiCall<RecommendationResponse> getRecommendationsV2(String slugName, RecommendationRequestBody options)
(Click for more details)


This method generates the customer’s highest-priority screen view campaign.

public static IDataApiCall<ScreenViewResponse> getScreenView()
(Click for more details) - DEPRECATED in version 5.5.0


This method generates a customer’s highest-priority screen view campaign from the feed with the provided feed slug.

public static IDataApiCall<ScreenView> generateScreenView(String feedSlug)
(Click for more details)

😕

We are sorry to hear that

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

😉

Awesome!

Thank you for helping improve out documentation. If you need help or have any questions, please consider contacting support.

Close modal icon Placeholder alt for modal to satisfy link checker