## Related terms

- mobile\-sdk
- campaign

See the [glossary](/glossary.md) for definitions.

---

# Campaigns


---

## Set Injector listener
---
This method sets callbacks for an injector module.
**Declared In:**  
lib/main/modules/InjectorModule.js
  
**Related To:**  
[ClientStateChangeListener](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#injector-listener)  
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">public setListener(listener: IInjectorListener)</code></pre>

  
**Discussion:**  
Learn more about the methods and the purpose of this listener [here](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#injector-listener).

## Set In-App Message listener
---
This method sets callbacks for in-app message campaigns.
**Declared In:**  
lib/main/modules/InjectorModule.js
  
**Related To:**  
[InjectorInAppMessageListener](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#injector-in-app-message-listener)  
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">public setInAppMessageListener(listener: IInjectorInAppMessageListener)</code></pre>

  
**Discussion:**  
Learn more about the methods and the purpose of this listener [here](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#injector-in-app-message-listener).

## Set Inline In-App Message listener
---
This method sets callbacks for inline in-app message campaigns.

|                                                 | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| ----------------------------------------------- | ----------- | --------------- | -------------------- | --------------- |
| <span style="color:green">Introduced in:</span> | 6.0.0       | 6.15.0          | 2.0.1                | 3.0.0           |


**Declared In:**  
lib/main/modules/InjectorModule.js
  
**Related To:**  
[InjectorInlineInAppMessageListener](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#injector-inline-in-app-message-listener)  
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">public setInlineInAppMessageListener(listener: IInlineInAppMessageListener)</code></pre>

  
**Parameters:**
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **listener** | [IInlineInAppMessageListener](/developers/mobile-sdk/class-reference/react-native/campaigns#iinlineinappmessagelistener) | yes | - | Object that implements the inline in-app message listener |
  
**Return Value:**  
No value is returned.
  
**Discussion:**  
Learn more about the methods and the purpose of this listener [here](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#injector-inline-in-app-message-listener).
The listener handles actions from inline in-app messages (URL, deeplink, custom action, custom method) and delivers components created by the SDK for event-triggered campaigns with no mounted component. Setting a new listener replaces the previous one.

**Example:**


<div class="content-tabs code-tabs" data-tab-group="tabgrp-1235">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1235-0" data-tab-group="tabgrp-1235" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1235-0" data-tab-group="tabgrp-1235" data-tab-active="true">

```JavaScript
Synerise.Injector.setInlineInAppMessageListener({
  onInlineInAppAvailable: (view, data) => {
    // Mount `view` for data.placementKey in your component tree
  },
  onOpenUrl: (data, url) => {
    //...
  },
  onDeepLink: (data, deepLink) => {
    //...
  },
  onCustomAction: (data, name, parameters) => {
    //...
  },
  onCustomMethod: (data, name, parameters, completion) => {
    completion.success({});
  },
});
```

</div>
</div>




## Render inline in-app message
---
This method triggers rendering of an inline in-app message in the component. Use it for campaigns with the on-demand trigger.

|                                                 | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| ----------------------------------------------- | ----------- | --------------- | -------------------- | --------------- |
| <span style="color:green">Introduced in:</span> | 6.0.0       | 6.15.0          | 2.0.1                | 3.0.0           |
**Declared In:**  
lib/main/modules/inapp/InlineInAppView.js
  
**Related To:**  
[InlineInAppView](/developers/mobile-sdk/class-reference/react-native/campaigns#inlineinappview)  
  
**Class:**  
[InlineInAppViewHandle](/developers/mobile-sdk/class-reference/react-native/campaigns#inlineinappviewhandle)
  
**Declaration:**  

<pre><code class="language-TypeScript">render(): void</code></pre>

  
**Return Value:**  
No value is returned.
  
**Discussion:**  
Call it on the component ref. The method matches only campaigns with the on-demand trigger for the component's placement key. The result is reported through the component callbacks (`onLoaded`, `onUpdated` or `onFailed`). The ref is available after the component is mounted.

**Example:**


<div class="content-tabs code-tabs" data-tab-group="tabgrp-1236">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1236-0" data-tab-group="tabgrp-1236" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1236-0" data-tab-group="tabgrp-1236" data-tab-active="true">

```JavaScript
const inlineViewRef = useRef(null);

<InlineInAppView
  ref={inlineViewRef}
  placementKey="home_top_banner"
  style={{ width: '100%', height: '100%' }}
/>

// Later, for example on a button press:
inlineViewRef.current?.render();
```

</div>
</div>


## Release inline in-app message view
---
This method tears the inline in-app message down (destroys the web view and clears the campaign data) while the component stays mounted.

|                                                 | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| ----------------------------------------------- | ----------- | --------------- | -------------------- | --------------- |
| <span style="color:green">Introduced in:</span> | n/a         | 6.15.0          | 2.0.1                | 3.0.0           |
**Declared In:**  
lib/main/modules/inapp/InlineInAppView.js
  
**Related To:**  
[InlineInAppView](/developers/mobile-sdk/class-reference/react-native/campaigns#inlineinappview)  
  
**Class:**  
[InlineInAppViewHandle](/developers/mobile-sdk/class-reference/react-native/campaigns#inlineinappviewhandle)
  
**Declaration:**  

<pre><code class="language-TypeScript">release(): void</code></pre>

  
**Return Value:**  
No value is returned.
  
**Discussion:**  
Use it when you keep the component mounted but want to free the placement, for example after the `onRemove` callback. Unmounting the component releases the native view automatically, so no call is needed in that case.

**Example:**


<div class="content-tabs code-tabs" data-tab-group="tabgrp-1237">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1237-0" data-tab-group="tabgrp-1237" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1237-0" data-tab-group="tabgrp-1237" data-tab-active="true">

```JavaScript
<InlineInAppView
  ref={inlineViewRef}
  placementKey="home_top_banner"
  style={{ width: '100%', height: '100%' }}
  onRemove={(data) => {
    setContainerHeight(0);
    inlineViewRef.current?.release();
  }}
/>
```

</div>
</div>


## Check if inline in-app message is rendered
---
This method checks if the component currently shows a rendered inline in-app message.

|                                                 | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| ----------------------------------------------- | ----------- | --------------- | -------------------- | --------------- |
| <span style="color:green">Introduced in:</span> | 6.0.0       | 6.15.0          | 2.0.1                | 3.0.0           |
**Declared In:**  
lib/main/modules/inapp/InlineInAppView.js
  
**Related To:**  
[InlineInAppView](/developers/mobile-sdk/class-reference/react-native/campaigns#inlineinappview)  
  
**Class:**  
[InlineInAppViewHandle](/developers/mobile-sdk/class-reference/react-native/campaigns#inlineinappviewhandle)
  
**Declaration:**  

<pre><code class="language-TypeScript">isRendered(): Promise&lt;boolean&gt;</code></pre>

  
**Return Value:**  
A Promise that resolves to **true** if the component shows a rendered campaign, otherwise **false**. It also resolves to **false** when the component is not mounted.

**Example:**


<div class="content-tabs code-tabs" data-tab-group="tabgrp-1238">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1238-0" data-tab-group="tabgrp-1238" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1238-0" data-tab-group="tabgrp-1238" data-tab-active="true">

```JavaScript
const isRendered = await inlineViewRef.current?.isRendered();
```

</div>
</div>


## Get inline in-app message data
---
This method returns the data of the inline in-app message currently shown in the component.

|                                                 | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| ----------------------------------------------- | ----------- | --------------- | -------------------- | --------------- |
| <span style="color:green">Introduced in:</span> | 6.0.0       | 6.15.0          | 2.0.1                | 3.0.0           |
**Declared In:**  
lib/main/modules/inapp/InlineInAppView.js
  
**Related To:**  
[InlineInAppView](/developers/mobile-sdk/class-reference/react-native/campaigns#inlineinappview)  
[InlineInAppMessageData](/developers/mobile-sdk/class-reference/react-native/campaigns#inlineinappmessagedata)  
  
**Class:**  
[InlineInAppViewHandle](/developers/mobile-sdk/class-reference/react-native/campaigns#inlineinappviewhandle)
  
**Declaration:**  

<pre><code class="language-TypeScript">getData(): Promise&lt;InlineInAppMessageData | null&gt;</code></pre>

  
**Return Value:**  
A Promise that resolves to an [InlineInAppMessageData](/developers/mobile-sdk/class-reference/react-native/campaigns#inlineinappmessagedata) object, or **null** when the component is not mounted or holds no rendered campaign.

**Example:**


<div class="content-tabs code-tabs" data-tab-group="tabgrp-1239">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1239-0" data-tab-group="tabgrp-1239" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1239-0" data-tab-group="tabgrp-1239" data-tab-active="true">

```JavaScript
const data = await inlineViewRef.current?.getData();
if (data != null) {
  console.log(data.campaignHash, data.placementKey);
}
```

</div>
</div>


## In-app context
---
A map sent to the backend for server-side Jinja evaluation in in-app message templates.

|                                                 | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| ----------------------------------------------- | ----------- | --------------- | -------------------- | --------------- |
| <span style="color:green">Introduced in:</span> | 5.14.0      | 6.14.0          | 1.10.0               | 2.11.0          |
**Declared In:**  
lib/main/modules/InjectorModule.js  
  
**Related To:**  
[InAppContextKey](/developers/mobile-sdk/class-reference/react-native/campaigns#inappcontextkey)  
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">get inAppContext(): { [key: string]: any }
set inAppContext(context: { [key: string]: any })</code></pre>

  
**Discussion:**  
A map sent to the backend for server-side Jinja evaluation in in-app message templates. Use [InAppContextKey.JinjavaContext](/developers/mobile-sdk/class-reference/react-native/campaigns#inappcontextkey) as a key to pass Jinja context variables. Call `notifyInAppContextChange()` after updating it to re-evaluate active inline in-app messages with the new values.

**Example:**


<div class="content-tabs code-tabs" data-tab-group="tabgrp-1240">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1240-0" data-tab-group="tabgrp-1240" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1240-0" data-tab-group="tabgrp-1240" data-tab-active="true">

```JavaScript
Synerise.Injector.inAppContext = {
  [InAppContextKey.JinjavaContext]: {
    firstName: 'Anna',
    cartValue: 199.99,
  },
};
Synerise.Injector.notifyInAppContextChange();
```

</div>
</div>


## Notify in-app context change
---
Notifies active in-app messages that the application context has changed.

|                                                 | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| ----------------------------------------------- | ----------- | --------------- | -------------------- | --------------- |
| <span style="color:green">Introduced in:</span> | 5.14.0      | 6.14.0          | 1.10.0               | 2.11.0          |
**Declared In:**  
lib/main/modules/InjectorModule.js  
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">public notifyInAppContextChange(): void</code></pre>

  
**Parameters:**  
No parameters.

**Return Value:**  
No value is returned.

**Discussion:**  
Notifies active in-app messages that the application context has changed. Call it after updating `inAppContext`. The SDK calls the `SRInApp.onContextFromApp(context)` JS callback with the current context in every displayed in-app message. The campaign is not re-rendered: server-side Jinja evaluation uses the `InAppContextKey.JinjavaContext` value only when a message is rendered.

**Example:**


<div class="content-tabs code-tabs" data-tab-group="tabgrp-1241">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1241-0" data-tab-group="tabgrp-1241" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1241-0" data-tab-group="tabgrp-1241" data-tab-active="true">

```JavaScript
Synerise.Injector.inAppContext = {
  [InAppContextKey.JinjavaContext]: { tier: 'gold' },
};
Synerise.Injector.notifyInAppContextChange();
```

</div>
</div>


## Close In-App message
---


Closes an in-app message and sends an `inApp.discard` event.  

Usage examples:
- Closing a top bar or bottom bar when the user taps outside the in-app area.
- Automatically dismissing messages when navigating away from a screen.
- Controlling in-app visibility based on app logic for a smoother user experience.

|                                                 | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| ----------------------------------------------- | ----------- | --------------- | -------------------- | --------------- |
| <span style="color:green">Introduced in:</span> | 5.7.0       | 6.7.0           | 1.5.0                 | 2.5.0           |




**Declared In:**  
lib/main/modules/InjectorModule.js

**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)

**Declaration:**  

<pre><code class="language-TypeScript">public closeInAppMessage(campaignHash: string)</code></pre>


**Parameters:**  
| Parameter        | Type   | Mandatory | Default | Description                              |
| ---------------- | ------ | --------- | ------- | ---------------------------------------- |
| **campaignHash** | string | yes       | -       | Unique identifier of the in-app campaign |



## Set Notifications listener
---
This method sets callbacks for notifications module.
**Declared In:**  
lib/main/modules/NotificationsModule.js
  
**Class:**  
[NotificationsModule](/developers/mobile-sdk/class-reference/react-native/modules#notifications)
  
**Declaration:**  

<pre><code class="language-TypeScript">public setListener(listener: INotificationsListener)</code></pre>


## Register for push notifications
---
This method passes the Firebase Token to Synerise for notifications.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

- You should call this method every time the user changes the system or application consent for notifications.
- The API key must have the `API_PERSONAL_DEVICE_CLIENT_UPDATE` permission from the **Client** group.
- If the registration fails, the SDK requests a token update again by a listener/delegate method ([Android](/developers/mobile-sdk/listeners-and-delegates/android-listeners#on-register-for-push-listener), [iOS](/developers/mobile-sdk/listeners-and-delegates/ios-delegates#synerise-delegate-register-for-push-notifications-is-needed), [React Native](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#notifications-listener), [Flutter](/developers/mobile-sdk/listeners-and-delegates/flutter-listeners#notifications-listener)).

</div></div></div>



**Declared In:**  
lib/main/modules/NotificationsModule.js
  
**Class:**  
[NotificationsModule](/developers/mobile-sdk/class-reference/react-native/modules#notifications)
  
**Declaration:**  

<pre><code class="language-TypeScript">public registerForNotifications(registrationToken: string, mobileAgreement: boolean | null, onSuccess: () =&gt; void, onError: (error: Error) =&gt; void)</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **registrationToken** | string | yes | - | Firebase Token |
| **mobileAgreement** | boolean | false | null | Agreement (consent) for mobile push campaigns |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |
  
**Return Value:**  
No value is returned.
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1242">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1242-0" data-tab-group="tabgrp-1242" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1242-0" data-tab-group="tabgrp-1242" data-tab-active="true">

```JavaScript
// If you integrate Firebase Messaging in the native part of app
Synerise.Notifications.setListener({
    onRegistrationToken: function(registrationToken) {
        Synerise.Notifications.registerForNotifications(registrationToken, true, function(){
            //success
        }, function() {
            //failure
        });
    },
    onNotification: function(payload) {
        //...
    }
    //...
    //other listener's methods
});
// Or if you want to use Firebase Messaging in react native
Synerise.Notifications.registerForNotifications("YOUR_FIREBASE_TOKEN", true, function(){
    //success
}, function() {
    //failure
});
```

</div>
</div>




## Check if push notification is from Synerise
---
This method verifies if a notification was sent by Synerise.


**Declared In:**  
lib/main/modules/NotificationsModule.js
  
**Class:**  
[NotificationsModule](/developers/mobile-sdk/class-reference/react-native/modules#notifications)
  
**Declaration:**  

<pre><code class="language-TypeScript">public isSyneriseNotification(payload: object): boolean</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **payload** | object | yes | - | Notification's key-value data object |
  
**Return Value:**  
**true** if a notification was sent by Synerise, otherwise **false**.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1243">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1243-0" data-tab-group="tabgrp-1243" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1243-0" data-tab-group="tabgrp-1243" data-tab-active="true">

```JavaScript
Synerise.Notifications.setListener({
    onNotification: function(payload) {
        if (Synerise.Notifications.isSyneriseNotification(payload)) {
            Synerise.Notifications.handleNotification(payload);
        }
    }
    //...
    //other listener's methods
});
```

</div>
</div>




## Check if push notification is a Simple Push Campaign
---
This method verifies if a notification’s sender is Synerise and if the notification is a Simple Push campaign


**Declared In:**  
lib/main/modules/NotificationsModule.js
  
**Class:**  
[NotificationsModule](/developers/mobile-sdk/class-reference/react-native/modules#notifications)
  
**Declaration:**  

<pre><code class="language-TypeScript">public isSyneriseSimplePush(payload: object): boolean</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **payload** | object | yes | - | Notification's key-value data object |
  
**Return Value:**  
**true** if a notification is a Simple Push, otherwise **false**.
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1244">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1244-0" data-tab-group="tabgrp-1244" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1244-0" data-tab-group="tabgrp-1244" data-tab-active="true">

```JavaScript
Synerise.Notifications.setListener({
    onNotification: function(payload) {
        if (Synerise.Notifications.isSyneriseSimplePush(payload)) {
            Synerise.Notifications.handleNotification(payload);
        }
    }
    //...
    //other listener's methods
});
```

</div>
</div>




## Check if push notification is a Silent Command
---
This method verifies if a notification’s sender is Synerise and if the notification is a Silent Command.


**Declared In:**  
lib/main/modules/NotificationsModule.js
  
**Class:**  
[NotificationsModule](/developers/mobile-sdk/class-reference/react-native/modules#notifications)
  
**Declaration:**  

<pre><code class="language-TypeScript">public isSilentCommand(payload: object): boolean</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **payload** | object | yes | - | Notification's key-value data object |
  
**Return Value:**  
**true** if a notification is a Silent Command, otherwise **false**.

**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1245">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1245-0" data-tab-group="tabgrp-1245" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1245-0" data-tab-group="tabgrp-1245" data-tab-active="true">

```JavaScript
Synerise.Notifications.setListener({
    onNotification: function(payload) {
        if (Synerise.Notifications.isSilentCommand(payload)) {
            Synerise.Notifications.handleNotification(payload);
        }
    }
    //...
    //other listener's methods
});
```

</div>
</div>




## Check if push notification is a Silent SDK Command
---
This method verifies if a notification's sender is Synerise and if the notification is a Silent SDK Command.


**Declared In:**  
lib/main/modules/NotificationsModule.js
  
**Class:**  
[NotificationsModule](/developers/mobile-sdk/class-reference/react-native/modules#notifications)
  
**Declaration:**  

<pre><code class="language-TypeScript">public isSilentSDKCommand(payload: object): boolean</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **payload** | object | yes | - | Notification's key-value data object |
  
**Return Value:**  
**true** if a notification is a Silent SDK Command, otherwise **false**.
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1246">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1246-0" data-tab-group="tabgrp-1246" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1246-0" data-tab-group="tabgrp-1246" data-tab-active="true">

```JavaScript
Synerise.Notifications.setListener({
    onNotification: function(payload) {
        if (Synerise.Notifications.isSilentSDKCommand(payload)) {
            Synerise.Notifications.handleNotification(payload);
        }
    }
    //...
    //other listener's methods
});
```

</div>
</div>




## Check if push notification is encrypted
---
This method verifies if a notification is encrypted.


**Declared In:**  
lib/main/modules/NotificationsModule.js
  
**Class:**  
[NotificationsModule](/developers/mobile-sdk/class-reference/react-native/modules#notifications)
  
**Declaration:**  

<pre><code class="language-TypeScript">public isNotificationEncrypted(payload: object): boolean</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **payload** | object | yes | - | Notification's key-value data object |
  
**Return Value:**  
**true** if a notification is encrypted, otherwise **false**.
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1247">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1247-0" data-tab-group="tabgrp-1247" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1247-0" data-tab-group="tabgrp-1247" data-tab-active="true">

```JavaScript
Synerise.Notifications.setListener({
    onNotification: function(payload) {
        if (Synerise.Notifications.isNotificationEncrypted(payload)) {
            Synerise.Notifications.decryptNotification(payload);
        }
    }
    //...
    //other listener's methods
});
```

</div>
</div>




## Decrypt push notification
---
This method decrypts the notification payload.
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

If the notification is not encrypted, the method returns the raw payload.

</div></div></div>
  
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

If a notification is not decrypted successfully, the method returns nil.

</div></div></div>



**Declared In:**  
lib/main/modules/NotificationsModule.js
  
**Class:**  
[NotificationsModule](/developers/mobile-sdk/class-reference/react-native/modules#notifications)
  
**Declaration:**  

<pre><code class="language-TypeScript">public decryptNotification(payload: object): object | null</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **payload** | object | yes | - | Notification's key-value data object |
  
**Return Value:**  
Notification’s key-value data object with decrypted content
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1248">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1248-0" data-tab-group="tabgrp-1248" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1248-0" data-tab-group="tabgrp-1248" data-tab-active="true">

```JavaScript
Synerise.Notifications.setListener({
    onNotification: function(payload) {
        let data = Synerise.Notifications.decryptNotification(payload)
        // custom notification implementation
    }
    //...
    //other listener's methods
});
```

</div>
</div>




## Handle Synerise push notification
---
This method handles a notification payload and starts activity.


**Declared In:**  
lib/main/modules/NotificationsModule.js
  
**Class:**  
[NotificationsModule](/developers/mobile-sdk/class-reference/react-native/modules#notifications)
  
**Declaration:**  

<pre><code class="language-TypeScript">public handleNotification(payload: object, actionIdentifier: string | null)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **payload** | object | yes | - | Notification's key-value data object |
  
**Return Value:**  
No value is returned.
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1249">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1249-0" data-tab-group="tabgrp-1249" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1249-0" data-tab-group="tabgrp-1249" data-tab-active="true">

```JavaScript
Synerise.Notifications.setListener({
    onNotification: function(payload) {
        Synerise.Notifications.handleNotification(payload);
    }
    //...
    //other listener's methods
});
```

</div>
</div>




## Removed methods

### <del>Check if push notification is a Banner Campaign</del> {#check-if-push-notification-is-a-banner-campaign}
---


This method verifies if a notification’s sender is Synerise and if the notification is a Banner campaign.

| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | 2.0.0 |




**Declared In:**  
lib/main/modules/NotificationsModule.js
  
**Class:**  
[NotificationsModule](/developers/mobile-sdk/class-reference/react-native/modules#notifications)
  
**Declaration:**  

<pre><code class="language-TypeScript">public isSyneriseBanner(payload: object): boolean</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **payload** | object | yes | - | Notification's key-value data object |
  
**Return Value:**  
**true** if a notification is a Banner, otherwise **false**.
  
**Example:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1250">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1250-0" data-tab-group="tabgrp-1250" data-tab-active="true">JavaScript</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1250-0" data-tab-group="tabgrp-1250" data-tab-active="true">

```JavaScript
Synerise.Notifications.setListener({
    onNotification: function(payload) {
        if (Synerise.Notifications.isSyneriseBanner(payload)) {
            Synerise.Notifications.handleNotification(payload);
        }
    }
    //...
    //other listener's methods
});
```

</div>
</div>




### <del>Fetch Banners</del> {#fetch-banners}
---


This method fetches banners set for mobile campaigns and caches the valid ones.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:red">Removed in:</span> | 4.6.0 | 4.7.0 | 0.12.0 | n/a |





<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This method was removed in SDK version 0.12.0.

</div></div></div>

  
**Declared In:**  
lib/main/modules/InjectorModule.js
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">public fetchBanners(onSuccess, onError)</code></pre>

  
**Parameters:**
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **onSuccess** | Function | no | - | Function to be executed when the operation is completed successfully |
| **onError** | Function | no | - | Function to be executed when the operation is completed with an error |
  
**Return Value:**  
No value is returned.



### <del>Get Banners</del> {#get-banners}
---


This method provides valid banners directly from SDK cache.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:red">Removed in:</span> | 4.6.0 | 4.7.0 | 0.12.0 | n/a |



<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This method was removed in SDK version 0.12.0.

</div></div></div>

  
**Declared In:**  
lib/main/modules/InjectorModule.js
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getBanners()</code></pre>

  
**Return Value:**  
No value is returned.

### <del>Show Banner</del> {#show-banner}
---


This method shows a banner immediately.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:red">Removed in:</span> | 4.6.0 | 4.7.0 | 0.12.0 | - |





<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This method was removed in SDK version 0.12.0.

</div></div></div>

  
  **Declared In:**  
lib/main/modules/InjectorModule.js
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">public showBanner(banner: object, markPresented: boolean)</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **banner** | object | yes | - | Object representation of a banner |
| **markPresented** | boolean | yes | - | Sets the banner as presented and this banner instance representation will not appear again |
  
**Return Value:**  
No value is returned.



### <del>Get Walkthrough</del> {#get-walkthrough}
---


This method fetches a walkthrough.

| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | 2.0.0 |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `CAMPAIGN_BACKEND_CAMPAIGN_READ` permission from the **Campaign** group.

</div></div></div>



**Declared In:**  
lib/main/modules/InjectorModule.js
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">public getWalkthrough()</code></pre>

  
**Return Value:**  
No value is returned.

### <del>Show Walkthrough</del> {#show-walkthrough}
---


This method shows a walkthrough when it is loaded.

| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | 2.0.0 |


**Declared In:**  
lib/main/modules/InjectorModule.js
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">public showWalkthrough()</code></pre>

  
**Return Value:**  
No value is returned.

### <del>Check if Walkthrough is loaded</del> {#check-if-walkthrough-is-loaded}
---


This method checks if a walkthrough is loaded.

| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | 2.0.0 |


**Declared In:**  
lib/main/modules/InjectorModule.js
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">public isWalkthroughLoaded(): boolean</code></pre>

  
**Return Value:**  
**true** if the walkthrough is loaded, otherwise returns **false**.

### <del>Check if is loaded Walkthrough unique</del> {#check-if-is-loaded-walkthrough-unique}
---


This method checks if the walkthrough is unique compared to the previous one.

| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | 2.0.0 |


**Declared In:**  
lib/main/modules/InjectorModule.js
  
**Class:**  
[InjectorModule](/developers/mobile-sdk/class-reference/react-native/modules#injector)
  
**Declaration:**  

<pre><code class="language-TypeScript">public isLoadedWalkthroughUnique(): boolean</code></pre>


**Return Value:**  
**true** if the loaded walkthrough is unique, otherwise returns **false**.
