React Native listeners

Initialization callbacks


Synerise.onReady(function() {
  ...
});

Synerise.onError(function(error) {
  ...
})

NotificationsListener

A listener to handle actions from the notifications module.

Synerise.Notifications.setListener({
  // The following method is called when Synerise receives a registration token from the native part of application
  // It is optional function
    onRegistrationToken: function(token) {
      ...
  },
  // The following method is called when registration for Push Notifications is needed.
  // It is optional function
  onNotification: function(payload) {
    ...
  },
  // The following method is called when Synerise receives a notification's payload from the native part of application.
  // It is optional function
  onRegistrationRequired: function() {
    ...
  }
});
Note: After invoking onRegistrationRequired function, you must invoke the Synerise.Notifications.registerForNotifications(registrationToken, mobileAgreement, onSuccess, onError) method again.

ClientStateListener

A listener to handle customer’s sign-in state changes.

Synerise.Client.setClientStateListener({
  // The following method is called when a client signs in.
  // It is optional function
  onClientSignedIn: function() {
    ...
  },
  // The following method is called when a client signs out
  // It is optional function
  onClientSignedOut: function(reason) {
    ...
  }
});

InjectorListener

Synerise.Injector.setListener({
  // The following method is called when Synerise handles URL action from campaign activities
  // It is required function
  onOpenUrl: function(url) {
  	...
  },
  // The following method is called when Synerise handles deep link action from campaign activities
  // It is required function
  onDeepLink: function(deepLink) {
    ...
  }
});

BannerListener

A listener to handle the states of a banner.

Synerise.Injector.setBannerListener({
  // The following method is called after a banner is loaded and Synerise SDK asks for permission to show it
  shouldPresent: function(object) {
    ...
  },
  // The following method is called after a banner appears
  onPresent: function() {
    ...
  },
  // The following method is called when a banner disappears
  onHide: function() {
    ...
  }
});

WalkthroughListener

A listener to handle the states of a walkthrough.

Synerise.Injector.setWalkthroughListener({
  // The following method is called when a walkthrough is loaded
  onLoad: function() {
    ...
  },
  // The following method is called when an error occurs while loading the walkthrough
  onLoadingError: function(error: Error) {
    ...
  },
  // The following method is called after a walkthrough appears
  onPresent: function() {
    ...
  },
  // The following method is called when a walkthrough disappears
  onHide: function() {
    ...
  }
});
😕

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