Modules

Synerise

Declared In:
Headers/SNRSynerise.h

Inherits From:
NSObject

Declaration:

class Synerise: NSObject

Properties:

Property Type Description
settings Settings Settings module to configure the SDK
Note: The settings property is statically accessible.

Methods:

This method sets an object for Synerise delegate methods.

static func setDelegate(_: SyneriseDelegate)
(Click for more details)


This method sets an object for notification delegate methods.

static func setNotificationDelegate(_: NotificationDelegate)
(Click for more details)


This method initializes Synerise.

static func initialize(clientApiKey:)
(Click for more details)


This method initializes Synerise SDK with custom environment settings.

static func initialize(clientApiKey:baseUrl:)
(Click for more details)


This method sets the salt string for request validation.

static func setRequestValidationSalt(_: String?)
(Click for more details)


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

static func changeClientApiKey(clientApiKey: String)
(Click for more details)


This method changes a Profile (formerly Client) API key dynamically, with additional parameters.

static func changeClientApiKey(_ clientApiKey: String, config: SNRInitializationConfig?) -> Void
(Click for more details)


This method sets the Synerise SDK host application type.

static func setHostApplicationType(_: HostApplicationType)
(Click for more details)


This method sets the Synerise SDK plugin version.

static func setHostApplicationSDKPluginVersion(_: String)
(Click for more details)


This method enables or disables console logs from Synerise SDK.

static func setDebugModeEnabled(_: Bool)
(Click for more details)


This method enables or disables crash handling by Synerise SDK.

static func setCrashHandlingEnabled(_: Bool)
(Click for more details)


This method sets the notification categories (including Synerise categories) that your app supports.

static func setNotificationCategories(_: Set<UNNotificationCategory>)
(Click for more details)


This method sets identifiers for Background Tasks processing.

static func setBackgroundTaskIdentifiers(_: [String])
(Click for more details)


This method verifies if a notification was sent by Synerise.

static func isSyneriseNotification(_: [AnyHashable: Any]) -> Bool
(Click for more details)


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

static func isSyneriseSimplePush(_: [AnyHashable: Any]) -> Bool
(Click for more details)


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

static func isSyneriseBanner(_: [AnyHashable: Any]) -> Bool
(Click for more details)


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

static func isSyneriseSilentCommand(_: [AnyHashable: Any]) -> Bool
(Click for more details)


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

static func isSyneriseSilentSDKCommand(_: [AnyHashable: Any]) -> Bool
(Click for more details)


This method verifies if a notification is encrypted.

static func isNotificationEncrypted(_: [AnyHashable: Any]) -> Bool
(Click for more details)


This method decrypts the notification payload.

static func decryptNotification(_: [AnyHashable: Any]) -> [AnyHashable: Any]?
(Click for more details)


This method handles a notification payload and starts activity.

static func handleNotification(_: [AnyHashable: Any])
(Click for more details)


This method handles a notification payload with a user interaction and starts activity.

static func handleNotification(_: [AnyHashable: Any], actionIdentifier: String)
(Click for more details)


Note:
  • Synerise Domain is declared as a global string constant - SNRSyneriseDomain
  • Synerise Bundle Identifier is declared as a global string constant - SNRSyneriseBundleIdentifier


Client

The module for managing customer account data, registration, authentication, and authorization.

Declared In:
Headers/SNRClient.h

Related To:
ClientStateDelegate
ClientRegisterAccountContext
ClientConditionalAuthResult
ClientConditionalAuthenticationContext
ClientAuthenticationContext
ClientOAuthAuthenticationContext
ClientFacebookAuthenticationContext
ClientAppleSignInAuthenticationContext
ClientAccountInformation
ClientUpdateAccountContext
ClientUpdateAccountBasicInformationContext
ClientPasswordResetRequestContext
ClientPasswordResetConfirmationContext
Token

Inherits From:
NSObject

Declaration:

class Client: NSObject

Methods:

This method sets an object for a customers’s state delegate methods.

static func setClientStateDelegate(_: ClientStateDelegate)
(Click for more details)


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

static func registerAccount(context: ClientRegisterAccountContext, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method confirms a customer account with the confirmation token.

static func confirmAccount(token: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method activates a customer with email.

static func activateAccount(email: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


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

static func requestAccountActivationByPin(email: String, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void
(Click for more details)


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

static func confirmAccountActivationByPin(pinCode: String, email: String, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void
(Click for more details)


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

static func signIn(email: String, password: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


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

static func signInConditionally(email: String, password: String, success: ((ClientAuthenticationResult) -> Void), failure: ((Error) -> Void))
(Click for more details)


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

static func authenticate(token: AnyObject, clientIdentityProvider: ClientIdentityProvider, authID: String?, context: ClientAuthenticationContext?, success: ((Bool) -> Void), failure: ((ApiError) -> Void))
(Click for more details)


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

static func authenticateConditionally(token: AnyObject, clientIdentityProvider: ClientIdentityProvider, authID: String?, context: ClientConditionalAuthenticationContext?, success: ((ClientAuthenticationResult) -> Void), failure: ((ApiError) -> Void))
(Click for more details)


This method authenticates a customer with OAuth.

static func authenticateByOAuth(accessToken: String, authID: String?, context: ClientOAuthAuthenticationContext?, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 3.7.6


This method authenticates a customer with OAuth.

static func authenticateByOAuthIfRegistered(accessToken: String, authID: String?, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 3.7.6


This method authenticates a customer with Facebook.

static func authenticateByFacebook(facebookToken: String, authID: String?, context: ClientFacebookAuthenticationContext?, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 3.7.6


This method authenticates a customer with Facebook.

static func authenticateByFacebookIfRegistered(facebookToken: String, authID: String?, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 3.7.6


This method authenticates a customer with Sign In With Apple.

static func authenticateByAppleSignIn(identityToken: Data, authID: String?, context: ClientAppleSignInAuthenticationContext?, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 3.7.6


This method authenticates a customer with Sign In With Apple.

static func authenticateByAppleSignInIfRegistered(identityToken: Data, authID: String?, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 3.7.6


This method signs in a customer in with the provided token payload.

static func authenticate(tokenPayload: TokenPayload, authID: String, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
(Click for more details)


This method authenticates a customer with Simple Authentication.

static func simpleAuthentication(data: ClientSimpleAuthenticationData, authID: String, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
(Click for more details)


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

static func isSignedIn() -> Bool
(Click for more details)


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

static func isSignedInViaSimpleAuthentication() -> Bool
(Click for more details)


This method signs out a customer out.

static func signOut()
(Click for more details)


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

static func signOut(mode: ClientSignOutMode)
(Click for more details) - DEPRECATED in version 4.11.0


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

static func signOut(mode: ClientSignOutMode, fromAllDevices: Bool, success: (() -> Void), failure: ((Error) -> Void))
(Click for more details)


This method refreshes the customer’s current token.

static func refreshToken(success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


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

static func retrieveToken(success: ((Token) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method retrieves the customer’s current UUID.

static func getUUID() -> String
(Click for more details)


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

static func getUUIDForAuthentication(authID: String) -> String
(Click for more details)


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

static func regenerateUUID()
(Click for more details)


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

static func regenerateUUID(clientIdentifier: String)
(Click for more details)


This method destroys the session completely.

static func destroySession()
(Click for more details)


This method gets a customer’s account information.

static func getAccount(success: ((ClientAccountInformation) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method retrieves events for an authenticated customer.

static func getEvents(apiQuery: ClientEventsApiQuery, success: (([ClientEventData]) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method updates a customer’s account’s basic information (without identification data: uuid, customId, email).

static func updateAccountBasicInformation(context: ClientUpdateAccountBasicInformationContext, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method updates a customer’s account information.

static func updateAccount(context: ClientUpdateAccountContext, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


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

static func requestPasswordReset(context: ClientPasswordResetRequestContext, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


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

static func confirmResetPassword(context: ClientPasswordResetConfirmationContext, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method changes a customer’s password.

static func changePassword(password: String, oldPassword: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method requests a customer’s email change.

static func requestEmailChange(email: String, password: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
DEPRECATED in version 3.7.1


This method requests a customer’s email change.

static func requestEmailChange(email: String, password: String?, externalToken: AnyObject?, authID: String?, success: ((Bool) -> Void), failure: ((ApiError) -> Void))
(Click for more details)


This method requests a customer’s email change by Facebook.

static func requestEmailChangeByFacebook(email: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
DEPRECATED in version 3.7.1


This method confirms an email change.

static func confirmEmailChange(token: String, newsletterAgreement: Bool, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


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

static func requestPhoneUpdate(phone: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


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

static func confirmPhoneUpdate(phone:confirmationCode: String, smsAgreement: Bool, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method deletes a customer’s account.

static func deleteAccount(clientAuthFactor: AnyObject, clientIdentityProvider: ClientIdentityProvider, authID: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method deletes a customer’s account.

static func deleteAccount(password: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 3.6.19


This method deletes a customer’s account by OAuth.

static func deleteAccountByOAuth(accessToken: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 3.6.19


This method deletes a customer’s account by Facebook.

static func deleteAccountByFacebook(facebookToken: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 3.6.19


This method deletes a customer’s account information by Sign In With Apple.

static func deleteAccountByAppleSignIn(identityToken: Data, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 3.6.19


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

static func registerForPush(registrationToken: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method passes the Firebase Token to Synerise for notifications.

static func registerForPush(registrationToken: String, mobilePushAgreement: Bool, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)



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:
Headers/SNRTracker.h

Related To:
Event
TrackerParams
TrackerParamsBuilder

Inherits From:
NSObject

Declaration:

class Tracker: NSObject

Methods:

This method sets an object for Tracker module delegate methods.

static func setDelegate(_: TrackerDelegate)
Click for more details


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

static func setCustomIdentifier(_: String?)
(Click for more details)


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

static func setCustomEmail(_: String?)
(Click for more details)


This method sends an event.

static func send(_: Event)
(Click for more details)


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

static func flushEvents(completionHandler: (() -> Void)?)
(Click for more details)



Injector

The module for handling Synerise UI activities such as walkthrough, banner, simple push, and so on.

Declared In:
Headers/SNRInjector.h

Inherits From:
NSObject

Declaration:

class Injector: NSObject

Methods:

This method sets an object for in-app messages delegate methods.

static func setInAppMessageDelegate(_: InjectorInAppMessageDelegate)
(Click for more details)


This method fetches a walkthrough.

static func getWalkthrough()
(Click for more details)


This method shows a walkthrough when it is loaded.

static func showWalkthrough()
(Click for more details)


This method checks if a walkthrough is loaded.

static func isWalkthroughLoaded() -> Bool
(Click for more details)


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

static func isLoadedWalkthroughUnique() -> Bool
(Click for more details)


This method fetches Push Notifications set for mobile campaigns.

static func getPushes(success: (([[AnyHashable: Any]]) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method provides valid banners directly from SDK cache.

static func getBanners() -> [[AnyHashable: Any]]
(Click for more details) - REMOVED in version 4.6.0


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

static func fetchBanners(success: (([[AnyHashable: Any]]) -> Void), failure: ((Error) -> Void))
(Click for more details) - REMOVED in version 4.6.0


This method shows a banner immediately.

static func showBanner(_: [AnyHashable: Any], markPresented: Bool)
(Click for more details) - REMOVED in version 4.6.0



Promotions

The module for handling promotions and vouchers from Synerise SDK.

Declared In:
Headers/SNRPromotions.h

Related To:
PromotionsApiQuery
PromotionIdentifier
PromotionResponse
Promotion
AssignVoucherResponse
VoucherCodesResponse

Inherits From:
NSObject

Declaration:

class Promotions: NSObject

Methods:

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

static func getPromotions(success: ((PromotionResponse) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method retrieves promotions that match the parameters defined in an API query.

static func getPromotions(apiQuery: PromotionsApiQuery, success: ((PromotionResponse) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method retrieves the promotion with the specified UUID.

static func getPromotion(uuid: String, success: ((Promotion) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method retrieves the promotion with the specified code.

static func getPromotion(code: String, success: ((Promotion) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method activates the promotion with the specified UUID.

static func activatePromotion(uuid: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method activates the promotion with the specified code.

static func activatePromotion(code: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method activates promotions with a code or with UUID in a batch.

static func activatePromotions(identifiers: [PromotionIdentifier], success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void
(Click for more details)


This method deactivates the promotion with the specified UUID.

static func deactivatePromotion(uuid: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method deactivates the promotion with the specified code.

static func deactivatePromotion(code: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method deactivates promotions with a code or with UUID in a batch.

static func deactivatePromotions(identifiers: [PromotionIdentifier], success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void
(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.

static func getOrAssignVoucher(poolUUID: String, success: ((AssignVoucherResponse) -> Void), failure: ((Error) -> Void))
(Click for more details)


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

A voucherCode.assigned event is produced.

static func assignVoucherCode(poolUUID: String, success: ((AssignVoucherResponse) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method retrieves voucher codes for a customer.

static func getAssignedVoucherCodes(success: ((VoucherCodesResponse) -> Void), failure: ((Error) -> Void))
(Click for more details)



Content

The module for handling content from Synerise backend such as documents, recommendations, and so on.

Declared In:
Headers/SNRContent.h

Related To:
Document
DocumentApiQuery
DocumentsApiQuery
RecommendationResponse
Recommendation
ScreenView
ScreenViewResponse
ScreenViewApiQuery

Inherits From:
NSObject

Declaration:

class Content: NSObject

Methods:

This method generates the document assigned to a slug.

static func getDocument(slug: String, success: (([AnyHashable: Any]) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 4.13.0


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

static func generateDocument(slug: String, success: ((Document) -> Void), failure: ((Error) -> Void))
(Click for more details)


This method generates the document that is defined for parameters provided in the query object.

static func generateDocument(apiQuery: DocumentApiQuery, success: ((Document) -> Void), failure: ((ApiError) -> Void))
(Click for more details)


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

static func getDocuments(apiQuery: DocumentsApiQuery, success: (([[AnyHashable: Any]]) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 4.13.0


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

static func getRecommendations(options: RecommendationOptions, success: ((RecommendationResponse) -> Void), failure: ((Error) -> Void))
(Click for more details) - DEPRECATED in version 4.13.0


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

static func getRecommendationsV2(options: RecommendationOptions, success: ((RecommendationResponse) -> Void), failure: ((Error) -> Void))
(Click for more details)


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

static func getScreenView(success: ((ScreenViewResponse) -> Void), failure: ((ApiError) -> Void))
(Click for more details) - DEPRECATED in version 4.13.0


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

static func generateScreenView(feedSlug: String, success: ((ScreenView) -> Void), failure: ((ApiError) -> Void))
(Click for more details)

This method generates customer’s highest-priority screen view campaign that is defined for parameters provided in the query object.

static func generateScreenView(apiQuery: ScreenViewApiQuery, success: ((ScreenView) -> Void), failure: ((ApiError) -> Void))
(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