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 |
settings
property is statically accessible.Methods:
This method sets an object for Synerise delegate methods.
static func setDelegate(_: SyneriseDelegate)
This method sets an object for notification delegate methods.
static func setNotificationDelegate(_: NotificationDelegate)
This method initializes Synerise.
static func initialize(clientApiKey:)
This method initializes Synerise SDK with custom environment settings.
static func initialize(clientApiKey:baseUrl:)
This method sets the salt string for request validation.
static func setRequestValidationSalt(_: String?)
This method changes a Profile (formerly Client) API key dynamically.
static func changeClientApiKey(clientApiKey: String)
This method changes a Profile (formerly Client) API key dynamically, with additional parameters.
static func changeClientApiKey(_ clientApiKey: String, config: SNRInitializationConfig?) -> Void
This method sets the Synerise SDK host application type.
static func setHostApplicationType(_: HostApplicationType)
This method sets the Synerise SDK plugin version.
static func setHostApplicationSDKPluginVersion(_: String)
This method enables or disables console logs from Synerise SDK.
static func setDebugModeEnabled(_: Bool)
This method enables or disables crash handling by Synerise SDK.
static func setCrashHandlingEnabled(_: Bool)
This method sets the notification categories (including Synerise categories) that your app supports.
static func setNotificationCategories(_: Set<UNNotificationCategory>)
This method sets identifiers for Background Tasks processing.
static func setBackgroundTaskIdentifiers(_: [String])
This method verifies if a notification was sent by Synerise.
static func isSyneriseNotification(_: [AnyHashable: Any]) -> Bool
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
This method verifies if a notification’s sender is Synerise and if the notification is a Banner campaign.
static func isSyneriseBanner(_: [AnyHashable: Any]) -> Bool
This method verifies if a notification’s sender is Synerise and if the notification is a Silent Command.
static func isSyneriseSilentCommand(_: [AnyHashable: Any]) -> Bool
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
This method verifies if a notification is encrypted.
static func isNotificationEncrypted(_: [AnyHashable: Any]) -> Bool
This method decrypts the notification payload.
static func decryptNotification(_: [AnyHashable: Any]) -> [AnyHashable: Any]?
This method handles a notification payload and starts activity.
static func handleNotification(_: [AnyHashable: Any])
This method handles a notification payload with a user interaction and starts activity.
static func handleNotification(_: [AnyHashable: Any], actionIdentifier: String)
- 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)
This method registers a new customer with an email, password, and optional data.
static func registerAccount(context: ClientRegisterAccountContext, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method confirms a customer account with the confirmation token.
static func confirmAccount(token: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method activates a customer with email.
static func activateAccount(email: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
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
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
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))
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))
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))
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))
This method authenticates a customer with OAuth.
static func authenticateByOAuth(accessToken: String, authID: String?, context: ClientOAuthAuthenticationContext?, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method authenticates a customer with OAuth.
static func authenticateByOAuthIfRegistered(accessToken: String, authID: String?, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method authenticates a customer with Facebook.
static func authenticateByFacebook(facebookToken: String, authID: String?, context: ClientFacebookAuthenticationContext?, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method authenticates a customer with Facebook.
static func authenticateByFacebookIfRegistered(facebookToken: String, authID: String?, success: ((Bool) -> Void), failure: ((Error) -> Void))
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))
This method authenticates a customer with Sign In With Apple.
static func authenticateByAppleSignInIfRegistered(identityToken: Data, authID: String?, success: ((Bool) -> Void), failure: ((Error) -> Void))
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
This method authenticates a customer with Simple Authentication.
static func simpleAuthentication(data: ClientSimpleAuthenticationData, authID: String, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
This method checks if a customer is signed in (via RaaS, OAuth, Facebook, Apple).
static func isSignedIn() -> Bool
This method checks if a customer is signed in (via Simple Authentication).
static func isSignedInViaSimpleAuthentication() -> Bool
This method signs out a customer out.
static func signOut()
This method signs out a customer out with a chosen mode.
static func signOut(mode: ClientSignOutMode)
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))
This method refreshes the customer’s current token.
static func refreshToken(success: ((Bool) -> Void), failure: ((Error) -> Void))
This method retrieves the customer’s current, active token.
static func retrieveToken(success: ((Token) -> Void), failure: ((Error) -> Void))
This method retrieves the customer’s current UUID.
static func getUUID() -> String
Retrieves the current UUID or generates a new one from a seed.
static func getUUIDForAuthentication(authID: String) -> String
This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.
static func regenerateUUID()
This method regenerates the UUID and clears the authentication token, login session, custom email, and custom identifier.
static func regenerateUUID(clientIdentifier: String)
This method destroys the session completely.
static func destroySession()
This method gets a customer’s account information.
static func getAccount(success: ((ClientAccountInformation) -> Void), failure: ((Error) -> Void))
This method retrieves events for an authenticated customer.
static func getEvents(apiQuery: ClientEventsApiQuery, success: (([ClientEventData]) -> Void), failure: ((Error) -> Void))
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))
This method updates a customer’s account information.
static func updateAccount(context: ClientUpdateAccountContext, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method requests a customer’s password reset with email.
static func requestPasswordReset(context: ClientPasswordResetRequestContext, success: ((Bool) -> Void), failure: ((Error) -> Void))
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))
This method changes a customer’s password.
static func changePassword(password: String, oldPassword: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method requests a customer’s email change.
static func requestEmailChange(email: String, password: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
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))
This method requests a customer’s email change by Facebook.
static func requestEmailChangeByFacebook(email: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method confirms an email change.
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 phone number.
static func requestPhoneUpdate(phone: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
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))
This method deletes a customer’s account.
static func deleteAccount(clientAuthFactor: AnyObject, clientIdentityProvider: ClientIdentityProvider, authID: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method deletes a customer’s account.
static func deleteAccount(password: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method deletes a customer’s account by OAuth.
static func deleteAccountByOAuth(accessToken: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method deletes a customer’s account by Facebook.
static func deleteAccountByFacebook(facebookToken: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method deletes a customer’s account information by Sign In With Apple.
static func deleteAccountByAppleSignIn(identityToken: Data, success: ((Bool) -> Void), failure: ((Error) -> Void))
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))
This method passes the Firebase Token to Synerise for notifications.
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:
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)
This method sets a custom identifier in the parameters of every event.
static func setCustomIdentifier(_: String?)
This method sets a custom email in the parameters of every event.
static func setCustomEmail(_: String?)
This method sends an event.
static func send(_: Event)
This method forces sending the events from the queue to the server.
static func flushEvents(completionHandler: (() -> Void)?)
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)
This method fetches a walkthrough.
static func getWalkthrough()
This method shows a walkthrough when it is loaded.
static func showWalkthrough()
This method checks if a walkthrough is loaded.
static func isWalkthroughLoaded() -> Bool
This method checks if the walkthrough is unique compared to the previous one.
static func isLoadedWalkthroughUnique() -> Bool
This method fetches Push Notifications set for mobile campaigns.
static func getPushes(success: (([[AnyHashable: Any]]) -> Void), failure: ((Error) -> Void))
This method provides valid banners directly from SDK cache.
static func getBanners() -> [[AnyHashable: Any]]
This method fetches banners set for mobile campaigns and caches the valid ones.
static func fetchBanners(success: (([[AnyHashable: Any]]) -> Void), failure: ((Error) -> Void))
This method shows a banner immediately.
static func showBanner(_: [AnyHashable: Any], markPresented: Bool)
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))
This method retrieves promotions that match the parameters defined in an API query.
static func getPromotions(apiQuery: PromotionsApiQuery, success: ((PromotionResponse) -> Void), failure: ((Error) -> Void))
This method retrieves the promotion with the specified UUID.
static func getPromotion(uuid: String, success: ((Promotion) -> Void), failure: ((Error) -> Void))
This method retrieves the promotion with the specified code.
static func getPromotion(code: String, success: ((Promotion) -> Void), failure: ((Error) -> Void))
This method activates the promotion with the specified UUID.
static func activatePromotion(uuid: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method activates the promotion with the specified code.
static func activatePromotion(code: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
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
This method deactivates the promotion with the specified UUID.
static func deactivatePromotion(uuid: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
This method deactivates the promotion with the specified code.
static func deactivatePromotion(code: String, success: ((Bool) -> Void), failure: ((Error) -> Void))
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
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))
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))
This method retrieves voucher codes for a customer.
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:
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))
This method generates the document that is defined for the provided slug.
static func generateDocument(slug: String, success: ((Document) -> Void), failure: ((Error) -> Void))
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))
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))
This method generates recommendations that are defined for the options provided.
static func getRecommendations(options: RecommendationOptions, success: ((RecommendationResponse) -> Void), failure: ((Error) -> Void))
This method generates recommendations that are defined for the options provided.
static func getRecommendationsV2(options: RecommendationOptions, success: ((RecommendationResponse) -> Void), failure: ((Error) -> Void))
This method generates the customer’s highest-priority screen view campaign.
static func getScreenView(success: ((ScreenViewResponse) -> Void), failure: ((ApiError) -> Void))
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)
static func generateScreenView(feedSlug: String, success: ((ScreenView) -> Void), failure: ((ApiError) -> Void))
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))