Modules
BaseModule
Main module abstract class for inheriting classes.
Declared In:
lib/main/modules/BaseModule.js
Declaration:
class BaseModule
Settings
The module for managing the SDK settings.
Declared In:
lib/main/modules/SettingsModule.js
Inherits From:
Module
Declaration:
class SettingsModule extends Module
Properties:
Property | Type | Description |
---|---|---|
sdk | ISettingsOptions | General settings - This group contains options related to the general functioning of mobile SDK |
notifications | ISettingsOptions | Notifications settings - This group contains options related to push notifications |
tracker | ISettingsOptions | Tracker - This group contains options related to tracking the customer activities in a mobile application |
inAppMessaging | ISettingsOptions | In-app messaging - This group contains options related to the in-app messages feature |
injector | ISettingsOptions | Injector - This group contains options related to displaying campaigns |
Note:
Learn more about settings here
Notifications
The module for managing notifications.
Declared In:
lib/main/modules/NotificationsModule.js
Inherits From:
Module
Declaration:
class NotificationsModule extends Module
Methods:
This method sets an object for Notifications listener methods.
public setListener(listener: INotificationsListener)
This method passes the Firebase Token to Synerise for notifications.
public registerForNotifications(registrationToken: string, mobileAgreement: boolean | null, onSuccess: () => void, onError: (error: Error) => void)
This method verifies if a notification was sent by Synerise.
public isSyneriseNotification(payload: object): boolean
This method verifies if a notification’s sender is Synerise and if the notification is a Simple Push campaign
public isSyneriseSimplePush(payload: object): boolean
This method verifies if a notification’s sender is Synerise and if the notification is a Banner campaign.
public isSyneriseBanner(payload: object): boolean
This method verifies if a notification’s sender is Synerise and if the notification is a Silent Command.
public isSilentCommand(payload: object): boolean
This method verifies if a notification’s sender is Synerise and if the notification is a Silent SDK Command.
public isSilentSDKCommand(payload: object): boolean
This method verifies if a notification is encrypted.
public isNotificationEncrypted(payload: object): boolean
This method decrypts the notification payload.
public decryptNotification(payload: object): object | null
This method handles a notification payload with a user interaction and starts activity.
public handleNotification(payload: object, actionIdentifier: string | null)
Client
The module for managing customer account data, registration, and authorization.
Declared In:
lib/main/modules/ClientModule.js
Related To:
ClientAccountRegisterContext
ClientIdentityProvider
ClientAuthContext
ClientOAuthAuthenticationContext
ClientFacebookAuthenticationContext
ClientAppleSignInAuthenticationContext
ClientAccountInformation
ClientAccountUpdateContext
Token
Inherits From:
Module
Declaration:
class ClientModule extends Module
Methods:
This method sets an object for customer’s state listener methods.
public setClientStateChangeListener(listener: IClientStateChangeListener)
This method registers a new customer with an email, password, and optional data.
public registerAccount(context: ClientAccountRegisterContext, onSuccess: () => void, onError: (error: Error) => void)
This method confirms a customer account with the confirmation token.
public confirmAccount(token: string, onSuccess: () => void, onError: (error: Error) => void)
This method activates a customer with email.
public activateAccount(email: string, onSuccess: () => void, onError: (error: Error) => void)
This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.
public signIn(email: string, password: string, onSuccess: () => void, onError: (error: Error) => void)
This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.
public signInConditionally(email: string, password: string, onSuccess: () => void, onError: (error: Error) => void)
This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.
public authenticate(token: string, provider: ClientIdentityProvider, context: ClientAuthContext, onSuccess: (authResult: ClientConditionalAuthResult) => void, onError: (error: Error) => void)
This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.
public authenticateConditionally(token: string, provider: ClientIdentityProvider, context: ClientAuthContext, onSuccess: (authResult: ClientConditionalAuthResult) => void, onError: (error: Error) => void)
This method authenticates a customer with OAuth.
public authenticateByOAuth(accessToken: string, context: ClientOAuthAuthenticationContext, onSuccess: () => void, onError: (error: Error) => void)
This method authenticates a customer with OAuth.
public authenticateByOAuthIfRegistered(accessToken: string, authID: string | null, onSuccess: () => void, onError: (error: Error) => void)
This method authenticates a customer with Facebook.
public authenticateByFacebook(facebookToken: string, context: ClientFacebookAuthenticationContext, onSuccess: () => void, onError: (error: Error) => void)
This method authenticates a customer with Facebook.
public authenticateByFacebookIfRegistered(facebookToken: string, authID: string | null, onSuccess: () => void, onError: (error: Error) => void)
This method authenticates a customer with Sign In With Apple.
public authenticateByAppleSignIn(identityToken: string, context: ClientAppleSignInAuthenticationContext, onSuccess: () => void, onError: (error: Error) => void)
This method authenticates a customer with Sign In With Apple.
public authenticateByAppleSignInIfRegistered(identityToken: string, authID: string, onSuccess: () => void, onError: (error: Error) => void)
This method authenticates a customer with Simple Authentication.
public simpleAuthentication(data: ClientSimpleAuthenticationData, authID: string, onSuccess: () => void, onError: (error: Error) => void)
This method checks if a customer is signed in (via RaaS, OAuth, Facebook, Apple).
public isSignedIn(): boolean
This method checks if a customer is signed in (via Simple Authentication).
public isSignedInViaSimpleAuthentication(): boolean
This method signs out a customer out.
public signOut()
This method signs out a customer out with a chosen mode and Determines if the method should sign out all devices
public signOutWithMode(mode: ClientSignOutMode, fromAllDevices: boolean, onSuccess: () => void, onError: (error: Error) => void)
This method refreshes the customer’s current token.
public refreshToken(onSuccess: () => void, onError: (error: Error) => void)
This method retrieves the customer’s current, active token.
public retrieveToken(onSuccess: (token: Token) => void, onError: (error: Error) => void)
This method retrieves the customer’s current UUID.
public getUUID(): string
This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.
public regenerateUUID()
This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.
public regenerateUUIDWithClientIdentifier(clientIdentifier: string)
This method destroys the session completely.
public destroySession()
This method gets a customer’s account information.
public getAccount(onSuccess: (clientAccountInformation: ClientAccountInformation) => void, onError: (error: Error) => void)
This method updates a customer’s account’s basic information (without identification data: uuid, customId, email).
public updateAccountBasicInformation(context: ClientAccountUpdateBasicInformationContext, onSuccess: () => void, onError: (error: Error) => void)
This method updates a customer’s account information.
public updateAccount(context: ClientAccountUpdateContext, onSuccess: () => void, onError: (error: Error) => void)
This method requests a customer’s password reset with email.
public requestPasswordReset(email: string, onSuccess: () => void, onError: (error: Error) => void)
This method confirm a customer’s password reset with the new password and token provided by password reset request.
public confirmPasswordReset(password: string, token: string, onSuccess: () => void, onError: (error: Error) => void)
This method changes a customer’s password.
public changePassword(oldPassword: string, newPassword: string, onSuccess: () => void, onError: (error: Error) => void)
This method requests a customer’s email change.
public requestEmailChange(email: string, password: string | null, externalToken: string | null, authID: string | null, onSuccess: () => void, onError: (error: Error) => void)
This method confirms an email change.
public confirmEmailChange(token: string, newsletterAgreement: boolean, onSuccess: () => void, onError: (error: Error) => void)
Requests a customer’s phone update. A confirmation code is sent to the phone number.
public requestPhoneUpdate(phone: string, onSuccess: () => void, onError: (error: Error) => void)
This method confirms a phone number update. This action requires the new phone number and confirmation code as parameters.
public confirmPhoneUpdate(phone: string, confirmationCode: string, smsAgreement: boolean, onSuccess: () => void, onError: (error: Error) => void)
This method requests a customer’s account registration process with the PIN code.
public requestAccountActivationByPin(email: string, onSuccess: () => void, onError: (error: Error)
This method confirms a customer’s account registration process with the PIN code.
public confirmAccountActivationByPin(pinCode: string, email: string, onSuccess: () => void, onError: (error: Error) => void)
This method deletes a customer’s account.
public deleteAccountByIdentityProvider(clientAuthFactor: string, clientIdentityProvider: ClientIdentityProvider, authID: string | null, onSuccess: () => void, onError: (error: Error) => void)
This method deletes a customer’s account.
public deleteAccount(password: string, onSuccess: () => void, onError: (error: Error) => void)
This method deletes a customer’s account by OAuth.
public deleteAccountByOAuth(password: string, onSuccess: () => void, onError: (error: Error) => void)
This method deletes a customer’s account by Facebook.
public deleteAccountByFacebook(password: string, onSuccess: () => void, onError: (error: Error) => void)
Tracker
The module for sending event tracking data to Synerise backend. Tracking is performed by creating pre-defined or custom event objects and sending these to Synerise. It also includes automatic event interception by the Auto-Tracking feature.
Declared In:
lib/main/modules/TrackerModule.js
Related To:
Event
Inherits From:
Module
Declaration:
class TrackerModule extends Module
Methods:
This method sets a custom identifier in the parameters of every event.
public setCustomIdentifier(identifier: string)
This method sets a custom email in the parameters of every event.
public setCustomEmail(email: string)
This method sends an event.
public send(event: Event)
This method forces sending the events from the queue to the server.
public flushEvents(onSuccess: () => void)
Injector
The module for handling Synerise UI activities such as walkthrough, banner, simple push, and so on.
Declared In:
lib/main/modules/InjectorModule.js
Inherits From:
Module
Declaration:
class InjectorModule extends Module
Methods:
This method sets an object for Injector listener methods.
public setListener(listener: IInjectorListener)
This method sets an object for in-app message listener methods.
public setInAppMessageListener(listener: IInjectorInAppMessageListener)
This method sets if banners should be shown or not.
public setShouldBannerPresentFlag(shouldPresentBanner: boolean)
This method fetches banners set for mobile campaigns and caches the valid ones.
public fetchBanners(onSuccess: (banners: Array<Object>) => void, onError: (error: Error) => void)
This method provides valid banners directly from SDK cache.
public getBanners(): Array<Object>
This method shows a banner immediately.
public showBanner(banner: Object, markPresented: boolean)
This method fetches a walkthrough.
public getWalkthrough()
This method shows a walkthrough when it is loaded.
public showWalkthrough()
This method checks if a walkthrough is loaded.
public isWalkthroughLoaded(): boolean
This method checks if the walkthrough is unique compared to the previous one.
public isLoadedWalkthroughUnique(): boolean
Promotions
The module for handling promotions and vouchers from Synerise SDK.
Declared In:
lib/main/modules/PromotionsModule.js
Related To:
PromotionResponse
Promotion
AssignVoucherResponse
VoucherCodesResponse
Inherits From:
Module
Declaration:
class PromotionsModule extends Module
Methods:
This method retrieves all available promotions that are defined for a customer.
public getAllPromotions(onSuccess: (promotionResponse: PromotionResponse) => void, onError: (error: Error) => void)
This method retrieves promotions that match the parameters defined in an API query.
public getPromotions(apiQuery: PromotionsApiQuery, onSuccess: (promotionResponse: PromotionResponse) => void, onError: (error: Error) => void)
This method retrieves the promotion with the specified UUID.
public getPromotionByUUID(uuid: string, onSuccess: (promotion: Promotion) => void, onError: (error: Error) => void)
This method retrieves the promotion with the specified code.
public getPromotionByCode(code: string, onSuccess: (promotion: Promotion) => void, onError: (error: Error) => void)
This method activates the promotion with the specified UUID.
public activatePromotionByUUID(uuid: string, onSuccess: () => void, onError: (error: Error) => void)
This method activates the promotion with the specified code.
public activatePromotionByCode(code: string, onSuccess: () => void, onError: (error: Error) => void)
This method activates promotions with a code or with UUID in a batch.
public activatePromotionsBatch(promotionsIdentifiers: Array<PromotionIdentifier>, onSuccess: () => void, onError: (error: Error) => void)
This method deactivates the promotion with the specified UUID.
public deactivatePromotionByUUID(uuid: string, onSuccess: () => void, onError: (error: Error) => void)
This method deactivates the promotion with the specified code.
public deactivatePromotionByCode(code: string, onSuccess: () => void, onError: (error: Error) => void)
This method deactivates promotions with a code or with UUID in a batch.
public deactivatePromotionsBatch(promotionsIdentifiers: Array<PromotionIdentifier>, onSuccess: () => void, onError: (error: Error) => void)
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 getOrAssignVoucher(poolUuid: string, onSuccess: (assignVoucherRespone: AssignVoucherResponse) => void, onError: (error: Error) => void)
This method assigns a voucher from a pool identified by UUID to the profile.
A voucherCode.assigned event is produced.
public assignVoucherCode(poolUuid: string, onSuccess: (assignVoucherRespone: AssignVoucherResponse) => void, onError: (error: Error) => void)
This method retrieves voucher codes for a customer.
public getAssignedVoucherCodes(onSuccess: (voucherCodesResponse: VoucherCodesResponse) => void, onError: (error: Error) => void)
Content
The module for handling content from Synerise backend such as documents, recommendations, and so on.
Declared In:
lib/main/modules/ContentModule.js
Related To:
RecommendationResponse
Recommendation
DocumentsApiQuery
Inherits From:
Module
Declaration:
class ContentModule extends Module
Methods:
This method generates the document assigned to a slug.
public getDocument(slug: string, onSuccess: (document: object) => void, onError: (error: Error) => void)
This method generates the document that is defined for the provided slug.
public generateDocument(slug: string, onSuccess: (document: Document) => void, onError: (error: Error) => void)
This method generates the document that is defined for the provided slug.
public generateDocumentWithApiQuer(slug: string, onSuccess: (document: Document) => void, onError: (error: Error) => void)
This method generates documents that are defined for parameters provided in the query object.
public getDocuments(apiQuery: DocumentsApiQuery, onSuccess: (documents: Array<object>) => void, onError: (error: Error) => void)
This method generates recommendations that are defined for the options provided.
public getRecommendations(options: RecommendationOptions, onSuccess: (recommendationResponse: RecommendationResponse) => void, onError: (error: Error) => void)
This method generates recommendations that are defined for the options provided.
public getRecommendationsV2(options: RecommendationOptions, onSuccess: (recommendationResponse: RecommendationResponse) => void, onError: (error: Error) => void)
This method generates the customer’s highest-priority screen view campaign.
public getScreenView(onSuccess: (screenViewResponse: ScreenViewResponse) => void, onError: (error: Error) => void)
This method generates a customer’s highest-priority screen view campaign from the feed with the provided feed slug.
public generateScreenView(slug: String, onSuccess: (screenView: ScreenView) => void, onError: (error: Error) => void)
This method generates a customer’s highest-priority screen view campaign from the feed with the provided feed slug.
public generateScreenViewWithApiQuery(apiQuery: ScreenViewApiQuery, onSuccess: (screenView: ScreenView) => void, onError: (error: Error) => void)