
---

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

<pre><code class="language-Dart">void listener(InjectorListenerFunction listenerFunction)</code></pre>

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

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

<pre><code class="language-Dart">void inAppMessageListener(InjectorInAppMessageListenerFunction listenerFunction)</code></pre>

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

## 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/modules/injector/injector_impl.dart

**Declaration:**  

<pre><code class="language-dart">void closeInAppMessage(String campaignHash)</code></pre>


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

## 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/modules/notifications/notifications_impl.dart

**Class:**  
[NotificationsImpl](/developers/mobile-sdk/class-reference/flutter/modules#notifications)


<div class="content-tabs" data-tab-group="tabgrp-896">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-896-0" data-tab-group="tabgrp-896" data-tab-active="true">SDK &gt;= 1.0.0</button><button class="tab-button" data-tab-id="tabgrp-896-1" data-tab-group="tabgrp-896">Legacy SDK</button></div>

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

**Declaration:**    

<pre><code class="language-Dart">Future&lt;void&gt; registerForNotifications(String registrationToken,
      {bool? mobileAgreement,
      required void Function() onSuccess,
      required void Function(SyneriseError error) onError})</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **registrationToken** | String | yes | - | Firebase Token |
| **mobileAgreement** | bool | no | null | Agreement (consent) for receiving mobile push campaigns |
| **onSuccess** | Function() | yes | - | Function to be executed when the operation is completed successfully |
| **onError** | Function([SyneriseError](/developers/mobile-sdk/class-reference/flutter/miscellaneous#syneriseerror) error) | yes | - | Function to be executed when the operation is completed with an error |

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


<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 also allows using the `registerForPushWithoutAgreement` native method.
The `registerForPushWithoutAgreement` method will be used when the `mobileAgreement` parameter is not filled.

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


**Example:**  

<pre><code class="language-Dart">FirebaseMessaging.instance.onTokenRefresh.listen((event) {
      FirebaseMessaging.instance.getToken().then((token) {
        if (token != null) {
          firebaseToken = token;
          Synerise.notifications.registerForNotifications(
            firebaseToken!,
            mobileAgreement: true,
            onSuccess: () {},
            onError: (error) {},
          );
        }
      });
    });</code></pre>

</div>

<div class="tab-panel" data-tab-id="tabgrp-896-1" data-tab-group="tabgrp-896">

**Declaration:**    

<pre><code class="language-Dart">Future&lt;void&gt; registerForNotifications(String registrationToken, [bool? mobileAgreement])</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **registrationToken** | String | yes | - | Firebase Token |
| **mobileAgreement** | bool | no | null | Agreement (consent) for receiving mobile push campaigns |

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


<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 also allows to use `registerForPushWithoutAgreement` native method.
The `registerForPushWithoutAgreement` method will be used when the `mobileAgreement` parameter is not filled.

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


**Example:**  

<pre><code class="language-Dart">FirebaseMessaging.instance.onTokenRefresh.listen((event) {
      FirebaseMessaging.instance.getToken().then((token) {
        if (token != null) {
          firebaseToken = token;
          Synerise.notifications.registerForNotifications(
            firebaseToken!,
            mobileAgreement: true,
          );
        }
      });
    });</code></pre>

</div>
</div>


## Handle Synerise push notification
---
This method handles a notification payload and starts activity.
**Declared In:**  
lib/modules/notifications/notifications_impl.dart  

**Class:**  
[NotificationsImpl](/developers/mobile-sdk/class-reference/flutter/modules#notifications)
  
**Declaration:**    

<pre><code class="language-Dart">Future&lt;bool&gt; handleNotification(Map notification) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **notification** | Map<String, dynamic> | yes | - | Notification’s key-value data object |

**Return Value:**  
**true** if the notification is handled properly.

**Example:**  

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

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

```Dart
FirebaseMessaging.onMessage.listen((RemoteMessage message,) {
  Synerise.notifications.handleNotification(message.toMap());
});

FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
  Synerise.notifications.handleNotificationClick(message.toMap());
});
```

</div>
</div>


## Handle Synerise push notification click
---
This method handles a notification payload with a user interaction and starts activity.
**Declared In:**  
lib/modules/notifications/notifications_impl.dart  

**Class:**  
[NotificationsImpl](/developers/mobile-sdk/class-reference/flutter/modules#notifications)
  
**Declaration:**    

<pre><code class="language-Dart">Future&lt;bool&gt; handleNotificationClick(Map notification) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **notification** | Map<String, dynamic> | yes | - | Notification’s key-value data object |

**Return Value:**  
**true** if the notification is handled properly.

**Example:**  

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

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

```Dart
FirebaseMessaging.onMessage.listen((RemoteMessage message,) {
  Synerise.notifications.handleNotification(message.toMap());
});

FirebaseMessaging.onMessageOpenedApp.listen((RemoteMessage message) {
  Synerise.notifications.handleNotificationClick(message.toMap());
});
```

</div>
</div>


## Check if push notification is from Synerise
---
This method verifies if a notification was sent by Synerise.
**Declared In:**  
lib/modules/notifications/notifications_impl.dart
  
**Class:**  
[NotificationsImpl](/developers/mobile-sdk/class-reference/flutter/modules#notifications)
  
**Declaration:**    

<pre><code class="language-Dart">Future&lt;bool&gt; isSyneriseNotification(Map notification) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **notification** | Map | yes | - | Key-Value map of data |
  
**Return Value:**  
**true** if the notification is provided by Synerise, otherwise returns **false**.
  
**Example:**

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

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

```Dart
bool isSyneriseNotification = await Synerise.notifications.isSyneriseNotification(remoteMessageMap);
```

</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/modules/notifications/notifications_impl.dart
  
**Class:**  
[NotificationsImpl](/developers/mobile-sdk/class-reference/flutter/modules#notifications)
  
**Declaration:**    

<pre><code class="language-Dart">Future&lt;bool&gt; isSyneriseSimplePush(Map notification) async</code></pre>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **notification** | Map | yes | - | Key-Value map of data |
  
**Return Value:**  
**true** if the notification is Synerise Simple Push provided by Synerise, otherwise returns **false**.
  
**Example:**

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

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

```Dart
bool isSyneriseSimplePush = await Synerise.notifications.isSyneriseSimplePush(remoteMessageMap);
```

</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/modules/notifications/notifications_impl.dart
  
**Class:**  
[NotificationsImpl](/developers/mobile-sdk/class-reference/flutter/modules#notifications)
  
**Declaration:**    

<pre><code class="language-Dart">Future&lt;bool&gt; isSilentCommand(Map notification) async</code></pre>

   
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **notification** | Map | yes | - | Key-Value map of data |
  
**Return Value:**  
**true** if the notification is Synerise Silent Command provided by Synerise, otherwise returns **false**.
  
**Example:**

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

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

```Dart
bool isSilentCommand = await Synerise.notifications.isSilentCommand(remoteMessageMap);
```

</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/modules/notifications/notifications_impl.dart
    
**Class:**  
[NotificationsImpl](/developers/mobile-sdk/class-reference/flutter/modules#notifications)

**Declaration:**    

<pre><code class="language-Dart">Future&lt;bool&gt; isSilentSDKCommand(Map notification) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **notification** | Map | yes | - | Key-Value map of data |
  
**Return Value:**  
**true** if the notification is Synerise Silent SDK Command provided by Synerise, otherwise returns **false**.
  
**Example:**

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

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

```Dart
bool isSilentSDKCommand = await Synerise.notifications.isSilentSDKCommand(remoteMessageMap);
```

</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 | n/a |
**Declared In:**  
lib/modules/notifications/notifications_impl.dart
  
**Class:**  
[NotificationsImpl](/developers/mobile-sdk/class-reference/flutter/modules#notifications)
  
**Declaration:**    

<pre><code class="language-Dart">Future&lt;bool&gt; isSyneriseBanner(Map notification) async</code></pre>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **notification** | Map | yes | - | Key-Value map of data |
  
**Return Value:**  
**true** if the notification is Synerise Banner provided by Synerise, otherwise returns **false**.
  
**Example:**

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

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

```Dart
bool isSyneriseBanner = await Synerise.notifications.isSyneriseBanner(remoteMessageMap);
```

</div>
</div>


### <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/modules/injector/injector_impl.dart  
  
**Class:**  
[InjectorImpl](/developers/mobile-sdk/class-reference/flutter/modules#injector)
  
**Declaration:**  

<pre><code class="language-Dart">void getWalkthrough()</code></pre>

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

**Example:**  

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

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

```Dart
Synerise.injector.getWalkthrough();
```

</div>
</div>


### <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/modules/injector/injector_impl.dart  
  
**Class:**  
[InjectorImpl](/developers/mobile-sdk/class-reference/flutter/modules#injector)
  
**Declaration:**  

<pre><code class="language-Dart">void showWalkthrough()</code></pre>

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

**Example:**  

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

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

```Dart
Synerise.injector.showWalkthrough();
```

</div>
</div>


### <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/modules/injector/injector_impl.dart  
  
**Class:**  
[InjectorImpl](/developers/mobile-sdk/class-reference/flutter/modules#injector)
  
**Declaration:**  

<pre><code class="language-Dart">Future&lt;bool&gt; isWalkthroughLoaded()</code></pre>

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

**Example:**  

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

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

```Dart
var isLoaded = await Synerise.injector.isWalkthroughLoaded();
```

</div>
</div>


### <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/modules/injector/injector_impl.dart  
  
**Class:**  
[InjectorImpl](/developers/mobile-sdk/class-reference/flutter/modules#injector)
  
**Declaration:**  

<pre><code class="language-Dart">Future&lt;bool&gt; isLoadedWalkthroughUnique()</code></pre>

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

**Example:**  

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

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

```Dart
var isLoaded = await Synerise.injector.isLoadedWalkthroughUnique();
```

</div>
</div>
