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 the object for a client’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 the JWT token which can be used in subsequent requests. (Click for more details)

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


Signs in a customer with an 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 an 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 a 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 a 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 whether a customer is signed in (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()


Use this method to refresh a customer token. (Click for more details)

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


Retrieves the current customer’s token. This method provides valid token if the customer is signed in and the current token is not expired. (Click for more details)

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


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

static func getUUID() -> String


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

static func regenerateUUID()


Regenerates a customer’s UUID and clear authentication token, login session (if one exists), 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 the 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. The customer will receive a token on the provided email address in order to use. (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 the token provided by email. (Click for more details)

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


Changes 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 a customer’s email change by Facebook.

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


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

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


Requests a customer’s phone update. A confirmation code is sent to the provided phone number. (Click for more details)

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


Confirms a customer’s phone number update with the code provided. (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))


Method to recognize anonymous customers and save personal information according to their CRM 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 the Tracker module delegate methods.

static func setDelegate(_: TrackerDelegate)


Sets a custom identifier for the current customer. (Click for more details)

static func setCustomIdentifier(_: String?)


Sets a custom email for the current customer. (Click for more details)

static func setCustomEmail(_: String?)


Adds a new event to tje 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 Walkthrough. (Click for more details)

static func getWalkthrough()


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

static func showWalkthrough()


Checks if Walkthrough is loaded. (Click for more details)

static func isWalkthroughLoaded() -> Bool


Checks if Walkthrough is unique compared to previous ones. (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 client. (Click for more details)

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


Gets promotions that are defined for the 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))


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

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


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

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


Gets a voucher code (always the same for a given customer) or assigns a voucher from the provided pool UUID for the customer. (Click for more details)

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


Assigns a voucher from the provided pool UUID for the customer. Every request returns a 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 a document identified by slug. (Click for more details)

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


Gets documents that are defined for the 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 a screen view with the highest priority applicable to the customer. (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.