Modules

Client

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

Declared In

SNRClient.h

ClientStateDelegate
ClientRegisterAccountContext
ClientOAuthAuthenticationContext
ClientFacebookAuthenticationContext
ClientAppleSignInAuthenticationContext
ClientAccountInformation
ClientUpdateAccountContext
ClientPasswordResetRequestContext
ClientPasswordResetConfirmationContext
Token

Inherits From

NSObject

Declaration

class Client: NSObject

Methods

Sets an object for a customers’s state delegate methods.

static func setClientStateDelegate(_: ClientStateDelegate)


Registers a new customer account. (Click for more details)

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


Confirms a customer’s account. (Click for more details)

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


Activates a customer’s account. (Click for more details)

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


Signs in a customer in order to obtain a JSON Web Token (JWT). (Click for more details)

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


Signs in a customer with OAuth Access Token. (Click for more details)

static func authenticateByOAuth(accessToken: String, authID: String?, context: ClientOAuthAuthenticationContext?, success: ((Bool) -> Void), failure: ((Error) -> Void))


Signs in a registered customer with OAuth Access Token. (Click for more details)

static func authenticateByOAuthIfRegistered(accessToken: String, authID: String?, success: ((Bool) -> Void), failure: ((Error) -> Void))


Signs in a customer with Facebook Token. (Click for more details)

static func authenticateByFacebook(facebookToken: String, authID: String?, context: ClientFacebookAuthenticationContext?, success: ((Bool) -> Void), failure: ((Error) -> Void))


Signs in a registered customer with Facebook Token. (Click for more details)

static func authenticateByFacebookIfRegistered(facebookToken: String, authID: String?, success: ((Bool) -> Void), failure: ((Error) -> Void))


Signs in a customer with Sign In With Apple. (Click for more details)

static func authenticateByAppleSignIn(identityToken: Data, authID: String?, context: ClientAppleSignInAuthenticationContext?, success: ((Bool) -> Void), failure: ((Error) -> Void))


Signs in a registered customer with Sign In With Apple. (Click for more details)

static func authenticateByAppleSignInIfRegistered(identityToken: Data, authID: String?, success: ((Bool) -> Void), failure: ((Error) -> Void))


Checks if a customer is signed in (if customer’s token is not expired). (Click for more details)

static func isSignedIn() -> Bool


Signs out a customer. (Click for more details)

static func signOut()


Refreshes the customer’s token. (Click for more details)

static func refreshToken(success: ((Bool) -> Void), failure: ((Error) -> Void))


Retrieves the customer’s token. (Click for more details)

static func retrieveToken(success: ((Token) -> Void), failure: ((Error) -> Void))


Retrieves the customer’s UUID. (Click for more details)

static func getUUID() -> String


Regenerates the customer’s UUID and clears authentication token, login (if applicable), custom email, and custom identifier. (Click for more details)

static func regenerateUUID()


Regenerates the customer’s UUID and clears authentication token, login (if applicable), custom email, and custom identifier. (Click for more details)

static func regenerateUUID(clientIdentifier: String)


Destroys the whole session completely. (Click for more details)

static func destroySession()


Gets a customer’s account information. (Click for more details)

static func getAccount(success: ((ClientAccountInformation) -> Void), failure: ((Error) -> Void))


Retrieves events for an authenticated customer. (Click for more details)

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


Updates a customer’s account information. (Click for more details)

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


Requests a customer’s password reset with email. (Click for more details)

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


Confirms a customer’s password reset with a new password and token. (Click for more details)

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


Changes a customer’s password. (Click for more details)

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


DEPRECATED - Requests a customer’s email change.

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


Requests a customer’s email change. (Click for more details)

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


DEPRECATED - Requests customer’s email change by Facebook.

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


Confirms a customer’s email change with a token. (Click for more details)

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


Requests a customer’s phone update. (Click for more details)

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


Confirms a customer’s phone update with a code. (Click for more details)

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


Deletes a customer’s account information. (Click for more details)

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


DEPRECATED - Deletes a customer’s account information. (Click for more details)

static func deleteAccount(password: String, success: ((Bool) -> Void), failure: ((Error) -> Void))


DEPRECATED - Deletes a customer’s account information by OAuth. (Click for more details)

static func deleteAccountByOAuth(accessToken: String, success: ((Bool) -> Void), failure: ((Error) -> Void))


DEPRECATED - Deletes a customer’s account information by Facebook. (Click for more details)

static func deleteAccountByFacebook(facebookToken: String, success: ((Bool) -> Void), failure: ((Error) -> Void))


DEPRECATED - Deletes a customer’s account information by Sign In With Apple. (Click for more details)

static func deleteAccountByAppleSignIn(identityToken: Data, success: ((Bool) -> Void), failure: ((Error) -> Void))


Recognizes anonymous customer and saves personal information from their database entries. (Click for more details)

static func recognizeAnonymous(email: String?, customIdentify: String?, parameters: [AnyHashable: Any]?)


Registers a customer for Push Notifications. (Click for more details)

static func registerForPush(registrationToken: String, mobilePushAgreement: Bool, success: ((Bool) -> Void), failure: ((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

SNRTracker.h

Event
TrackerParams
TrackerParamsBuilder

Inherits From

NSObject

Declaration

class Tracker: NSObject

Methods

Sets an object for Tracker module delegate methods.

static func setDelegate(_: TrackerDelegate)


Sets the custom identifier for the current customer. The custom identifier will be sent with every event in event params. (Click for more details)

static func setCustomIdentifier(_: String?)


Sets the custom email for the current customer. The custom email will be sent with every event in event params. (Click for more details)

static func setCustomEmail(_: String?)


Adds a new event to the queue and sends available events to the server if possible. (Click for more details)

static func send(_: Event)


Sends events from the queue to the server by force. (Click for more details)

static func flushEvents(completionHandler: (() -> Void)?)



Injector

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

Declared In

SNRInjector.h

Inherits From

NSObject

Declaration

class Injector: NSObject

Methods

Sets an object for walkthrough delegate methods.

static func setWalkthroughDelegate(_: WalkthroughDelegate)


Sets an object for banner delegate methods.

static func setBannerDelegate(_: BannerDelegate)


Fetches a walkthrough. (Click for more details)

static func getWalkthrough()


Shows a walkthrough when it is loaded. (Click for more details)

static func showWalkthrough()


Checks if a walkthrough is loaded. (Click for more details)

static func isWalkthroughLoaded() -> Bool


Checks if the walkthrough is unique compared to the previous one. (Click for more details)

static func isLoadedWalkthroughUnique() -> Bool


Provides valid banners directly from SDK cache. (Click for more details)

static func getBanners() -> [[AnyHashable: Any]]


Fetches banners set for mobile campaigns and caches the valid ones. (Click for more details)

static func fetchBanners(success: (([[AnyHashable: Any]]) -> Void), failure: ((Error) -> Void))


Fetches Push Notifications set for mobile campaigns. (Click for more details)

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


Shows a banner immediately. (Click for more details)

static func showBanner(_: [AnyHashable: Any], markPresented: Bool)



Promotions

The module for handling promotions and vouchers from Synerise SDK.

Declared In

SNRPromotions.h

PromotionResponse
Promotion
AssignVoucherResponse
VoucherCodesResponse

Inherits From

NSObject

Declaration

class Promotions: NSObject

Methods

Gets all available promotions that are defined for this customer. (Click for more details)

static func getPromotions(success: ((PromotionResponse) -> Void), failure: ((Error) -> Void))


Gets promotions that are defined for parameters provided in the query object. (Click for more details)

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


Gets a promotion identified by UUID. (Click for more details)

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


Gets a promotion identified by code. (Click for more details)

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


Activates a promotion identified by UUID. (Click for more details)

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


Activates a promotion identified by code. (Click for more details)

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


De-activates a promotion identified by UUID. (Click for more details)

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


De-activates promotion identified by code. (Click for more details)

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


Gets a voucher code permanently assigned to a customer (the same code every time). If no code is permanently assigned, the method assigns a voucher from the provided pool so that the same code is returned in all future calls. (Click for more details)

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


Assigns a voucher from a pool to a customer. Every request returns different code until the pool is empty. (Click for more details)

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


Gets a customer’s voucher codes. (Click for more details)

static func getAssignedVoucherCodes(success: ((VoucherCodesResponse) -> Void), failure: ((Error) -> Void))



Content

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

Declared In

SNRContent.h

RecommendationResponse
Recommendation
DocumentsApiQuery

Inherits From

NSObject

Declaration

class Content: NSObject

Methods

Gets the document that is defined for the provided slug. (Click for more details)

static func getDocument(slug: String, success: (([AnyHashable: Any]) -> Void), failure: ((Error) -> Void))


Gets documents that are defined for parameters provided in the query object. (Click for more details)

static func getDocuments(apiQuery: DocumentsApiQuery, success: (([[AnyHashable: Any]]) -> Void), failure: ((Error) -> Void))


Gets recommendations that are defined for the options provided. (Click for more details)

static func getRecommendations(options: RecommendationOptions, success: ((RecommendationResponse) -> Void), failure: ((Error) -> Void))


Gets the customer’s highest-priority screen view campaign. (Click for more details)

static func getScreenView(success: ((ScreenViewResponse) -> Void), failure: ((ApiError) -> Void))

😕

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.