iOS delegates
SyneriseDelegate
A delegate to handle actions from the Synerise SDK.
This method is called when the Synerise SDK is initialized.
func snr_initialized() -> Void
This method is called when an error occurs while initializing the Synerise SDK.
func snr_initializationError(error: Error) -> Void
Parameter | Type | Description |
---|---|---|
error | NSError |
The error that occurred. |
This method is called when Synerise needs registration for Push Notifications.
Client.registerForPush(registrationToken:mobilePushAgreement:success:failure:)
method again.func snr_registerForPushNotificationsIsNeeded() -> Void
This method is called when Synerise handles URL action from campaign activities.
snr_handledAction(url:activity:completionHandler:)
method is not implemented.func snr_handledAction(url: URL) -> Void
Parameter | Type | Description |
---|---|---|
url | NSURL |
URL address value from the activity. |
This method is called when Synerise handles URL action from campaign activities.
func snr_handledAction(url: URL, activity: SyneriseActivity, completionHandler: SyneriseActivityCompletionHandler) -> Void
Parameter | Type | Description |
---|---|---|
url | NSURL |
URL address value from the activity. |
activity | SyneriseActivity |
Identifies Synerise campaign activity (SyneriseActivity ). |
completionHandler | SyneriseActivityAction |
A block/closure that should be invoked with SyneriseActivityAction parameters and a completion block to execute. |
This method is called when Synerise handles deeplink action from campaign activities.
snr_handledAction(deepLink:activity:completionHandler:)
method is not implemented.func snr_handledAction(deepLink: String) -> Void
Parameter | Type | Description |
---|---|---|
deeplink | String |
Literal text value from the activity. |
This method is called when Synerise handles deeplink action from campaign activities.
func snr_handledAction(deepLink: String, activity: SyneriseActivity, completionHandler: SyneriseActivityCompletionHandler) -> Void
Parameter | Type | Description |
---|---|---|
deeplink | String |
Literal text value from activity. |
activity | SyneriseActivity |
Identifies Synerise campaign activity (SyneriseActivity ). |
completionHandler | SyneriseActivityAction |
A block/closure that should be invoked with parameters: SyneriseActivityAction and completion block to execute. |
NotificationDelegate
A delegate to handle events from Synerise notifications.
See Configuring push notifications for more details.
NotificationDelegate
is available from 4.10.0 SDK version. All methods are optional.This method is called when a Synerise notification is received.
snr_notificationDidReceive(notificationInfo: NotificationInfo)
Parameter | Type | Description |
---|---|---|
notificationInfo | NotificationInfo |
Object providing information about the notification. |
This method is called when a Synerise notification is dismissed.
func snr_notificationDidDissmis(notificationInfo: NotificationInfo)
Parameter | Type | Description |
---|---|---|
notificationInfo | NotificationInfo |
Object providing information about the notification. |
This method is called when a Synerise notification is clicked.
func snr_notificationClicked(notificationInfo: NotificationInfo)
Parameter | Type | Description |
---|---|---|
notificationInfo | NotificationInfo |
Object providing information about the notification. |
This method is called when an action button is clicked in a Synerise notification.
func snr_notificationClicked(notificationInfo: NotificationInfo, actionButton: String)
Parameter | Type | Description |
---|---|---|
notificationInfo | NotificationInfo |
Object providing information about the notification. |
actionButton | String |
Text on the clicked action button. |
ClientStateDelegate
A delegate to handle customer’s sign-in state changes.
This method is called when a client signs in.
func snr_clientIsSignedIn() -> Void
This method is called when a customer signs out.
func snr_clientIsSignedOut(reason: ClientSessionEndReason) -> Void
Parameter | Type | Description |
---|---|---|
reason | ClientSessionEndReason |
Specifies the reason for signing out. |
InjectorBannerDelegate
A delegate to handle events from banner campaigns.
This method is called after a banner is loaded and Synerise SDK asks for permission to show it.
func snr_shouldBannerAppear(bannerDictionary: [AnyHashable: Any]) -> Bool
Parameter | Type | Description |
---|---|---|
bannerDictionary | [AnyHashable: Any] |
Dictionary representation of the banner. |
This method is called after a banner appears.
func snr_bannerDidAppear() -> Void
This method is called after a banner disappears.
func snr_bannerDidDisappear() -> Void
InAppMessageDelegate
A delegate to handle events from in-app message campaigns.
InAppMessageDelegate
is available from 4.6.0 SDK version.This method is called after an in-app message is loaded and Synerise SDK asks for permission to show it.
func snr_shouldInAppMessageAppear(data: InAppMessageData) -> Bool
Parameter | Type | Description |
---|---|---|
data | InAppMessageData |
Model representation of the in-app message. |
This method is called after an in-app message appears.
func snr_inAppMessageDidAppear(data: InAppMessageData) -> Void
Parameter | Type | Description |
---|---|---|
data | InAppMessageData |
Model representation of the in-app message. |
This method is called after an in-app message disappears.
func snr_inAppMessageDidDisappear(data: InAppMessageData) -> Void
Parameter | Type | Description |
---|---|---|
data | InAppMessageData |
Model representation of the in-app message. |
This method is called when an in-app message changes its size.
func snr_inAppMessageDidChangeSize(rect: CGRect) -> Void
Parameter | Type | Description |
---|---|---|
data | InAppMessageData |
Model representation of the in-app message. |
This method is called when an individual context (for example a profile ID, an item SKU) for an in-app message is needed.
func snr_inAppMessageContextIsNeeded(data: InAppMessageData) -> [AnyHashable: Any]?
Parameter | Type | Description |
---|---|---|
data | InAppMessageData |
Model representation of the in-app message. |
This method is called when Synerise handles a URL action from in-app messages.
func snr_inAppMessageHandledAction(data: InAppMessageData, url: URL) -> Void
Parameter | Type | Description |
---|---|---|
data | InAppMessageData |
Model representation of the in-app message. |
url | URL |
URL address value from the activity. |
This method is called when Synerise handles a deeplink action from in-app messages.
func snr_inAppMessageHandledAction(data: InAppMessageData, deeplink: String) -> Void
Parameter | Type | Description |
---|---|---|
data | InAppMessageData |
Model representation of the in-app message. |
deeplink | String |
Literal text value from the activity. |
This method is called when a custom action is handled from in-app messages.
func snr_inAppMessageHandledCustomAction(data: InAppMessageData, name: String, parameters: [AnyHashable: Any]) -> Void
Parameter | Type | Description |
---|---|---|
data | InAppMessageData |
Model representation of the in-app message. |
name | String |
Custom action name for identification. |
parameters | [AnyHashable: Any] |
Custom action parameters. |
InjectorWalkthroughDelegate
A delegate to handle events from walkthrough campaigns.
When you choose to load and present a walkthrough manually, you may be interested in the following delegate methods.
This method is called after a walkthrough is loaded.
snr_walkthroughDidLoad(walkthroughDictionary: [AnyHashable: Any])
method is not implemented.func snr_walkthroughDidLoad()
This method is called after a walkthrough is loaded.
func snr_walkthroughDidLoad(walkthroughDictionary: [AnyHashable: Any])
Parameter | Type | Description |
---|---|---|
walkthroughDictionary | [AnyHashable: Any] |
Dictionary representation of the walkthrough. |
This method is called when an error occurs while loading a walkthrough.
func snr_walkthroughLoadingError(error: Error)
Parameter | Type | Description |
---|---|---|
error | NSError |
The error that occurred. |
This method is called after a walkthrough appears.
func snr_walkthroughDidAppear()
This method is called after a walkthrough disappears.
func snr_walkthroughDidDisappear()
TrackerDelegate
A delegate to handle events from the Tracker.
This method is called when the Tracker requests a location update.
func snr_locationUpdateRequired() -> Void
NotificationServiceExtensionDelegate
A delegate to handle events from Notification Extension Service.
This method is called when the decryption process fails.
func notificationServiceExtensionDidFailDecryptionWithError(_: Error)
Parameter | Type | Description |
---|---|---|
error | NSError |
The error that occurred |
This method is called when the processing notification operation fails.
func notificationServiceExtensionDidFailProcessingWithError(_: Error)
Parameter | Type | Description |
---|---|---|
error | NSError |
The error that occurred |
ContentWidgetDelegate
A delegate to handle Content Widget actions.
This method is called after a widget is loaded.
func snr_widgetDidLoad(widget: ContentWidget) -> Void
Parameter | Type | Description |
---|---|---|
widget | ContentWidget |
The widget instance that called the delegate method. |
This method is called when an error occurs while loading a widget.
func snr_widgetDidNotLoad(widget:ContentWidget error: Error) -> Void
Parameter | Type | Description |
---|---|---|
widget | ContentWidget |
The widget instance that called the delegate method. |
error | NSError |
The error that occurred. |
This method is called when the customer clicks a widget’s item.
func snr_widgetDidReceiveClickAction(widget:ContentWidget model: BaseModel) -> Void
Parameter | Type | Description |
---|---|---|
widget | ContentWidget |
The widget instance that called the delegate method. |
model | BaseModel |
The model’s object that was clicked. |
This method is called when the widget’s loading state changes.
func snr_widgetIsLoading(widget: ContentWidget isLoading: Bool) -> Void
Parameter | Type | Description |
---|---|---|
widget | ContentWidget |
The widget instance that called the delegate method. |
isLoading | Bool |
Widget’s loading state. |
This method is called when the widget’s size changes.
func snr_widgetDidChangeSize(widget: ContentWidget size: CGSize) -> Void
Parameter | Type | Description |
---|---|---|
widget | ContentWidget |
The widget instance that called the delegate method. |
size | CGSize |
Widget’s new size. |