Skip to content

How to define specific action on notification or in app primary button tap(open url, deeplink)?

Alexander Boldyrev edited this page Oct 30, 2024 · 3 revisions

Supported on Android since version 3.4.0

Available actions:

  • Opening of the external web content in webView
  • Opening of the external web content in device browser
  • Opening of particular mobile app screen over deeplink

To set up action via Broadcast or Flow choose "Mobile Push" channel and specify action button properties:

  • Action: Choose from the list
  • URL: Provide required URL or deeplink

Also, you can set up action for push or Mirror push notification using API by specifying notificationOptions.primaryButtonAction

Implementation of action handling within the application

Opening of the external web content in webView

WebView will be opened automatically without additional coding, but theme could be customized as described in How to open application webView on message tap?

Opening of the external web content in device browser

Will be opened automatically without additional coding.

Opening of particular mobile app screen over deeplink

Example can be found by the link - How to use "deeplink" to land user to a particular app page?

Message object

Message object can contain following fields, depending on action, which is used.

val webViewUrl: String = message.webViewUrl // URL, url to display in webView
val browserUrl: String = message.browserUrl // URL, url to open in browser
val deepLink: String = message.deeplink // URL, deeplink url
expand to see Java code

String webViewUrl = message.getWebViewUrl(); // URL, url to display in webView
String browserUrl = message.getBrowserUrl(); // URL, url to open in browser
String deepLink = message.getDeeplink(); // URL, deeplink url
Clone this wiki locally