
## Types of actions in campaigns
---
Campaigns can have three action types:
- **OPEN APP** - This option opens your app after clicking the notification. If the app is already in the foreground, clicking the notification doesn't have any effect.
- **OPEN URL** - This option opens a URL. Depending on your implementation, the link is opened in the browser by default or in your custom implementation, such as a webview in your application.
- **DEEP LINKING** - This option lets you transfer users to a specific view in your app by system methods or by your custom implementation.

## Handling actions from campaigns {id=handling-actions-from-campaigns}
---
You can handle actions from campaigns by using dedicated listeners and delegates:
- [OnInjectorListener](/developers/mobile-sdk/listeners-and-delegates/android-listeners#on-injector-listener) for [handling actions in Android](/developers/mobile-sdk/campaigns/action-handling#handling-actions-from-campaigns-in-android)
- [SyneriseDelegate](/developers/mobile-sdk/listeners-and-delegates/ios-delegates#synerise-delegate) for [handling actions in iOS](/developers/mobile-sdk/campaigns/action-handling#handling-actions-from-campaigns-in-ios)
- [InjectorListener](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#injector-listener) for [handling actions in React Native](/developers/mobile-sdk/campaigns/action-handling#handling-actions-from-campaigns-in-react-native)
- [InjectorListener](/developers/mobile-sdk/listeners-and-delegates/flutter-listeners#injector-listener) for [handling actions in Flutter](/developers/mobile-sdk/campaigns/action-handling#handling-actions-from-campaigns-in-flutter)

If you don't implement listener/delegate for handling actions in your customized way:
- The SDK runs the default browser with the requested URL address for **OPEN URL**.
- The SDK tries to handle the deep link in the host app by a system method for **DEEP LINKING**.


  <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">

  On iOS, deep links require special attention. The default SDK behaviour uses the [UIApplication.shared.canOpenURL(_:)](https://developer.apple.com/documentation/uikit/uiapplication/1622952-canopenurl) method. That method verifies a whitelist of deep links in `LSApplicationQueriesSchemes` key in the `\*.plist` file. Read more in [Apple documentation](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html#//apple_ref/doc/plist/info/LSApplicationQueriesSchemes).

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


### Android {id=handling-actions-from-campaigns-in-android}

You can handle actions from each type of campaign in your own customized way by using [OnInjectorListener](/developers/mobile-sdk/listeners-and-delegates/android-listeners#on-injector-listener) methods. 

The [OnInAppListener](/developers/mobile-sdk/listeners-and-delegates/android-listeners#on-in-app-listener) monitors when a [JS method is used in an in-app message](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#javascript-methods-in-in-app-messages).

In extended methods for handling **OPEN URL** and **DEEP LINKING**, the following parameters are available:
- URL value from the action of the activity.
- Deep link value from the action of the activity.
- [`SyneriseSource`](/developers/mobile-sdk/class-reference/android/campaigns#synerisesource): enum that defines the kind of activity from the action that was sent.

#### Configuration {id=configuration-for-handling-actions-from-campaigns-in-android}

1. Make your activity available for deep linking by including the following parameters in your AndroidManifest:
   
   <pre><code class="language-XML">&lt;activity
         android:name=".ui.linking.DeepLinkingActivity"&gt;
         &lt;intent-filter&gt;
             &lt;action android:name="syne://test" /&gt;
             &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;data 
                 android:scheme="syne"
                 android:host="test" /&gt;
         &lt;/intent-filter&gt;
      &lt;/activity&gt;</code></pre>


   For the configuration above, the sample **deep link** parameter is `syne://test?param=value`, where:
   - `syne` and `test` are the scheme and host provided in the intent filter.
   - `parameter` is the parameter name.
   - `value` is the parameter value.

   
   <div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   Your action name must be the same as your URI scheme and host.

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

2. **Optional**: Define an activity to be called after closing the activity that was initiated by deep linking. Provide an additional intent category:
   
   <div class="highlight-code-block" data-hl-lines="7">
   <pre><code class="language-XML">&lt;activity
         android:name=".ui.linking.DeepLinkingActivity"
         android:parentActivityName=".ui.linking.ParentDeepLinkingActivity"&gt;
         &lt;intent-filter&gt;
             &lt;action android:name="android.intent.action.VIEW" /&gt;
             &lt;category android:name="android.intent.category.DEFAULT" /&gt;
             &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
             &lt;data
                 android:host="test"
                 android:scheme="syne" /&gt;
         &lt;/intent-filter&gt;
      &lt;/activity&gt;</code></pre>
   </div>



   <div class="admonition admonition-tip"><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="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   If your deep link doesn't contain the `://` characters after the scheme, it is treated as a regular string key and set to the Intent's action.  
   This means that you can set an action name (in your AndroidManifest activity's intent filter) to any string and then match it with the provided deep link.

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


#### Sample implementation {id=handling-open-url-deeplink-actions-in-android}


<pre><code class="language-java">InjectorActionHandler.setOnInjectorListener(new OnInjectorListener() {
  @Override
  public boolean onOpenUrl(SyneriseSource source, String url) {
    //your implementation of OPEN URL action
    return false;
  }

  @Override
  public boolean onDeepLink(SyneriseSource source, String deepLink) {
    //your implementation of DEEP LINKING action
    return false;
  }
});</code></pre>



<div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

If you don't configure a custom action, the SDK applies the default behavior, as described [earlier](/developers/mobile-sdk/campaigns/action-handling#handling-actions-from-campaigns).

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


### iOS {id=handling-actions-from-campaigns-in-ios}

You can handle actions from each type of campaign in your own customized way by using [SyneriseDelegate](/developers/mobile-sdk/listeners-and-delegates/ios-delegates#synerise-delegate) methods. 

The [InjectorInAppMessageDelegate](/developers/mobile-sdk/listeners-and-delegates/ios-delegates#injector-in-app-message-delegate) monitors when a [JS method is used in an in-app message](/docs/campaign/in-app-messages/creating-inapp-templates/creating-inapp-template#javascript-methods-in-in-app-messages).

In extended methods for handling **OPEN URL** and **DEEP LINKING**, the following parameters are available:
- URL value from the action of the activity.
- Deep link value from the action of the activity.
- [`SyneriseSource`](/developers/mobile-sdk/class-reference/ios/campaigns#synerisesource): enum that defines the kind of activity from the action that was sent.  
    This enum replaces the deprecated [`SyneriseActivity` enum](/developers/mobile-sdk/class-reference/ios/campaigns#syneriseactivity).
- `SyneriseActivityCompletionHandler`: block/closure that defines whether an activity should be hidden or not and what code should be invoked after.

#### Sample implementation of OPEN URL action {id=handling-open-url-action-in-ios}

This way you can, for example, check the type of activity or use your own webview to show the web page.


<pre><code class="language-swift">// MARK: - SyneriseDelegate

func snr_handledAction(url: URL, source: SyneriseSource) {
  if source == .simplePush {
    if UIApplication.shared.canOpenURL(url) {
      UIApplication.shared.openURL(url)
    }
    return
  }

  if source == .simplePush {
    //...
    return
  }
}</code></pre>



#### Sample implementation of DEEP LINKING action {id=handling-deeplink-action-in-ios}

This way you can, for example, check the type of activity and handle your deep link in a custom way.


<pre><code class="language-swift">// MARK: - SyneriseDelegate

func snr_handledAction(deepLink: String, source: SyneriseSource) {
  if source == .inAppMessage {
    goToHelpWithId(deepLink)
    return
  }

  if source == .simplePush {
    goToMessageWithId(deepLink)
    return
  }
}</code></pre>


#### System method to handle deep links

The code below presents a system method sample implementation to handle deep links. See [Apple Developer - UIApplication.open(_:options:completionHandler:)](https://developer.apple.com/documentation/uikit/uiapplication/1648685-open) method for more details.



<pre><code class="language-swift">@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
  //...
  //other methods
  func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -&gt; Bool {
    let sourceApplication: String? = options[UIApplication.OpenURLOptionsKey.sourceApplication] as? String
    let annotation: Any? = options[UIApplication.OpenURLOptionsKey.annotation]
        
    let handled: Bool = ApplicationDelegate.shared.application(app, open: url, sourceApplication: sourceApplication, annotation: annotation)
      if handled == true {
        return true
      }
        
      if url.scheme == "sample-swift" {
        applicationController.getMainCoordinator()?.didReceiveDeeplink(host: url.host!, pathComponents: url.pathComponents)
        return true
      }
        
    return false
  }
}</code></pre>



<div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

If you don't configure a custom action, the SDK applies the default behavior, as described [earlier](/developers/mobile-sdk/campaigns/action-handling#handling-actions-from-campaigns).

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


### React Native {id=handling-actions-from-campaigns-in-react-native}

You can specify your custom action when a customer interacts with your simple push, banner, walkthrough, or in-app message.

You can handle actions from each type of campaign in your own customized way by using [InjectorListener](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#injector-listener) methods.

In listener methods for handling **OPEN URL** and **DEEP LINKING**, the following parameters are available:
- URL value from the action of the activity.
- Deep link value from the action of the activity.
- [`SyneriseSource`](/developers/mobile-sdk/class-reference/react-native/campaigns#synerisesource): enum that defines the kind of activity from the action that was sent.


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

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

  ```JavaScript
  Synerise.Injector.setListener({
    onOpenUrl: function(url, source) {
      //your implementation of OPEN URL action
      Linking.openURL(url);
    },
    onDeepLink: function(deepLink, source) {
      //your implementation of DEEP LINKING action
    }
    //...
    //other listener's methods
  });
  ```

  </div>
  </div>



<div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

If you don't configure a custom action, the SDK applies the default behavior, as described [earlier](/developers/mobile-sdk/campaigns/action-handling#handling-actions-from-campaigns).

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


### Flutter {id=handling-actions-from-campaigns-in-flutter}

You can specify your custom action when a customer interacts with your simple push, banner, walkthrough, or in-app message.

You can handle actions from each type of campaign in your own customized way by using [InjectorListener](/developers/mobile-sdk/listeners-and-delegates/flutter-listeners#injector-listener) methods.

In listener methods for handling **OPEN URL** and **DEEP LINKING**, the following parameters are available:
- URL value from the action of the activity.
- Deep link value from the action of the activity.
- [`SyneriseSource`](/developers/mobile-sdk/class-reference/flutter/campaigns#synerisesource): enum that defines the kind of activity from the action that was sent.


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

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

  ```Dart
  Synerise.injector.listener((listener) {
    listener.onOpenUrl = (url, source) {
      //your implementation of OPEN URL action
    };
    listener.onDeepLink = (deepLink, source) {
      //your implementation of DEEP LINKING action
    };
    //...
    //other listener's methods
  });
  ```

  </div>
  </div>



<div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

If you don't configure a custom action, the SDK applies the default behavior, as described [earlier](/developers/mobile-sdk/campaigns/action-handling#handling-actions-from-campaigns).

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


## Universal linking
---
Universal links help your users follow links to content in your app or to your website. When they open a universal link, their mobile OS checks whether any installed app is registered for that domain. If there is no configured application URL for a given path, the user stays on the website.


<div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

In order to send universal links from Synerise, you must use the **OPEN URL** action in your campaign configuration on Synerise UI.

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


### Android {id=universal-linking-in-android}

In order to implement universal links, you need to configure them in the `AndroidManifest.xml` file in your application.

Add data to your activity in order to connect a URL with a screen.  


<pre><code class="language-XML">&lt;activity
  android:name=".ui.dev.tracker.TrackerViewActivity"
  android:screenOrientation="portrait"&gt;
  &lt;intent-filter&gt;
      &lt;action android:name="android.intent.action.VIEW" /&gt;
      &lt;category android:name="android.intent.category.DEFAULT" /&gt;
      &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
      &lt;data
          android:host="synerise.com"
          android:pathPrefix="/tracker"
          android:scheme="https" /&gt;
      &lt;!-- note that the leading "/" is required for pathPrefix--&gt;
  &lt;/intent-filter&gt;
&lt;/activity&gt;</code></pre>


### iOS {id=universal-linking-in-ios}

To implement universal links:
1. On your app identifier, enable `Associated Domains`
2. In your Xcode project, enable `Associated Domain` (in capabilities).
3. Configure your website to host the `apple-app-site-association` file.
    
   <pre><code class="language-json">{
         "applinks": {
           "apps": [],
           "details": [
             {
               "appID": “&lt;&lt;TEAM_ID&gt;&gt;.com.synerise.sdk.sample",
               "paths": [
                 "*"
               ]
             }
           ]
         }
       }</code></pre>

4. Configure your app to handle universal links.

    
   <div class="content-tabs code-tabs" data-tab-group="tabgrp-15">
   <div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-15-0" data-tab-group="tabgrp-15" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-15-1" data-tab-group="tabgrp-15">Objective-C</button></div>

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

   ```Swift
   func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([Any]?) -> Void) -> Bool {
     if userActivity.activityType == NSUserActivityTypeBrowsingWeb {
       let url = userActivity.webpageURL!
       print(url.absoluteString)
       // handle url and run app action that you want
     }

     return true
   }
   ```

   </div>

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

   ```Objective-C
   - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler{
     if ([userActivity.activityType isEqualToString: NSUserActivityTypeBrowsingWeb]) {
       NSURL *url = userActivity.webpageURL;
       NSLog(@"URL: %@", url.absoluteString);
       // handle url and run app action that you want
     }

     return YES;
   }
   ```

   </div>
   </div>


For more details, see [Apple Developer - Universal Links for Developers](https://developer.apple.com/ios/universal-links/).

## Handling actions from campaigns (older SDK versions) {id=handling-actions-from-campaigns-in-older-sdk-versions}
---

### Android (version 5.12.0 and lower) {id=legacy-handling-actions-from-campaigns-in-android}

You can handle actions in your own customized way by using:
- [InjectorListener](/developers/mobile-sdk/listeners-and-delegates/android-listeners#on-injector-listener) methods for simple push.
- [InAppMessageListener](/developers/mobile-sdk/listeners-and-delegates/android-listeners#on-in-app-listener) methods for in-app messages.


  <div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

  You cannot handle actions in your own customized way for simple push. It works as default, so **OPEN URL** opens the browser and **DEEP LINKING** opens an activity associated with this deep link.

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


#### Configuration {id=legacy-configuration-for-handling-actions-from-campaigns-in-android}

1. Make your activity available for deep linking by including the following parameters in your AndroidManifest:
   
   <pre><code class="language-XML">&lt;activity
         android:name=".ui.linking.DeepLinkingActivity"&gt;
         &lt;intent-filter&gt;
             &lt;action android:name="syne://test" /&gt;
             &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;data 
                 android:scheme="syne"
                 android:host="test" /&gt;
         &lt;/intent-filter&gt;
      &lt;/activity&gt;</code></pre>

   
   <div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   Your action name must be the same as your URI scheme and host.

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

2. **Optional**: Define an activity to be called after closing the activity that was initiated by deep linking. Provide an additional intent category:
   
   <div class="highlight-code-block" data-hl-lines="7">
   <pre><code class="language-XML">&lt;activity
         android:name=".ui.linking.DeepLinkingActivity"
         android:parentActivityName=".ui.linking.ParentDeepLinkingActivity"&gt;
         &lt;intent-filter&gt;
             &lt;action android:name="android.intent.action.VIEW" /&gt;
             &lt;category android:name="android.intent.category.DEFAULT" /&gt;
             &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
             &lt;data
                 android:host="test"
                 android:scheme="syne" /&gt;
         &lt;/intent-filter&gt;
      &lt;/activity&gt;</code></pre>
   </div>


   For the configuration above, the sample **deep link** parameter is `syne://test?param=value`, where:
   - `syne` and `test` are the scheme and host provided in the intent filter.
   - `parameter` is the parameter name.
   - `value` is the parameter value.

   
   <div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   Your action name must be the same as your URI scheme and host.

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

   
2. **Optional**: Define an activity to be called after closing the activity that was initiated by deep linking. Provide an additional intent category:
   
   <div class="highlight-code-block" data-hl-lines="7">
   <pre><code class="language-XML">&lt;activity
         android:name=".ui.linking.DeepLinkingActivity"
         android:parentActivityName=".ui.linking.ParentDeepLinkingActivity"&gt;
         &lt;intent-filter&gt;
             &lt;action android:name="android.intent.action.VIEW" /&gt;
             &lt;category android:name="android.intent.category.DEFAULT" /&gt;
             &lt;category android:name="android.intent.category.BROWSABLE" /&gt;
             &lt;data
                 android:host="test"
                 android:scheme="syne" /&gt;
         &lt;/intent-filter&gt;
      &lt;/activity&gt;</code></pre>
   </div>



   <div class="admonition admonition-tip"><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="M9.663 17h4.673M12 3v1m6.364 1.636l-.707.707M21 12h-1M4 12H3m3.343-5.657l-.707-.707m2.828 9.9a5 5 0 117.072 0l-.548.547A3.374 3.374 0 0014 18.469V19a2 2 0 11-4 0v-.531c0-.895-.356-1.754-.988-2.386l-.548-.547z" /></svg></div><div class="admonition-body"><div class="admonition-content">

   If your deep link doesn't contain the `://` characters after the scheme, it is treated as a regular string key and set to the Intent's action.  
   This means that you can set an action name (in your AndroidManifest activity's intent filter) to any string and then match it with the provided deep link.

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


#### Simple Push {id=legacy-handling-simple-push-actions-in-android}

The SDK handle those actions by default, so **OPEN URL** opens the browser and **DEEP LINKING** opens an activity associated with this deep link.

   

#### In-app messages {id=legacy-handling-in-app-message-actions-in-android}

The SDK allows you to handle those actions. By default, an **OPEN URL** opens the browser and **DEEP LINKING** opens an activity associated with this deep link.

You can specify your custom action when a customer interacts with your in-app messages.


<div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The callbacks presented below work only with in-app message.

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


If you want to implement your own behavior, refer to the following code: 


<div class="content-tabs code-tabs" data-tab-group="tabgrp-16">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-16-0" data-tab-group="tabgrp-16" data-tab-active="true">Java</button><button class="tab-button" data-tab-id="tabgrp-16-1" data-tab-group="tabgrp-16">Kotlin</button></div>

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

```Java
public static OnInAppListener NULL = new OnInAppListener() {
  @Override
  public void onHandledOpenUrl(InAppMessageData inAppMessageData) {
    //your implementation of OPEN URL action
  }

  @Override
  public void onHandledOpenDeepLink(InAppMessageData inAppMessageData) {
    //your implementation of DEEP LINKING action
  }
};
```

</div>

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

```Kotlin
var inAppCallbacks: OnInAppListener = object : OnInAppListener() {
  override fun onHandledOpenUrl(inAppMessageData: InAppMessageData) {
    //your implementation of OPEN URL action
  }

  override fun onHandledOpenDeepLink(inAppMessageData: InAppMessageData) {
    //your implementation of DEEP LINKING action
  }
}
```

</div>
</div>


- `onHandledOpenUrl(InAppMessageData)` - callback is fired when a customer interacts with the **OPEN URL** action. Returns **true** if the activity is closed after the action is executed, **false** otherwise.
- `onHandledOpenDeepLink(InAppMessageData)` - callback is fired when a customer interacts with the **DEEP LINKING** action. Returns **true** if the activity is closed after the action is executed, **false** otherwise.

### React Native (version 0.17.0 and lower) {id=legacy-handling-actions-from-campaigns-in-react-native}


<div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

React Native SDK (version 0.17.0 and lower) cannot handle actions by default, you must implement it.

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


You can handle actions in your own customized way by using:
 - [InjectorListener](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#injector-listener) methods for simple push, banner and walkthrough
 - [InjectorInAppMessageListener](/developers/mobile-sdk/listeners-and-delegates/react-native-listeners#injector-in-app-message-listener) methods for in-app messages.

#### Simple Push, Banner and Walkthrough {id=legacy-handling-simple-push-banner-walkthrough-actions-in-react-native}

You can specify your custom action when a customer interacts with your simple push, banner, or walkthrough.


<div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

On Android, you cannot handle actions in your own customized way for simple push. It works as default so **OPEN URL** opens the browser and **DEEP LINKING** opens an activity.

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



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

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

```JavaScript
Synerise.Injector.setListener({
  onOpenUrl: function(url) {
    //your implementation of OPEN URL action
    Linking.openURL(url);
  },
  onDeepLink: function(deepLink) {
    //your implementation of DEEP LINKING action
  }
  //...
  //other listener's methods
});
```

</div>
</div>



#### In-app messages {id=legacy-handling-in-app-message-actions-in-react-native}

You can specify your custom action when a customer interacts with your in-app messages.


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

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

```JavaScript
Synerise.Injector.setInAppMessageListener({
  onOpenUrl: function(data, url) {
    //your implementation of OPEN URL action
  },
  onDeepLink: function(data, deepLink) {
    //your implementation of DEEP LINKING action
  },
  //...
  //other listener's methods
});
```

</div>
</div>


### Flutter (version 0.7.4 and lower) {id=legacy-handling-actions-from-campaigns-in-flutter}


<div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Flutter SDK (version 0.7.4 and lower) cannot handle actions by default, you must implement it.

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


You can handle actions in your own customized way by using:
 - [InjectorListener](/developers/mobile-sdk/listeners-and-delegates/flutter-listeners#injector-listener) methods for simple push, banner and walkthrough
 - [InjectorInAppMessageListener](/developers/mobile-sdk/listeners-and-delegates/flutter-listeners#injector-in-app-message-listener) methods for in-app messages.
  

#### Simple Push, Banner and Walkthrough {id=legacy-handling-simple-push-banner-walkthrough-actions-in-flutter}

You can specify your custom action when a customer interacts with your simple push, banner, or walkthrough.


<div class="admonition admonition-important"><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="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

On Android, you cannot handle actions in your own customized way for simple push. It works as default so **OPEN URL** opens the browser and **DEEP LINKING** opens an activity.

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



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

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

```Dart
Synerise.injector.listener((listener) {
  listener.onOpenUrl = (url) {
    //your implementation of OPEN URL action
  };
  listener.onDeepLink = (deepLink) {
    //your implementation of DEEP LINKING action
  };
  //...
  //other listener's methods
});
```

</div>
</div>



#### In-app messages {id=legacy-handling-in-app-message-actions-in-flutter}

You can specify your custom action when a customer interacts with your in-app messages.


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

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

```Dart
Synerise.injector.inAppMessageListener((listener) {
  listener.onOpenUrl = (data, url) {
    //your implementation of OPEN URL action
  };
  listener.onDeepLink = (data, deepLink) {
    //your implementation of DEEP LINKING action
  };
  //...
  //other listener's methods
});
```

</div>
</div>

