diff --git a/In-app-notifications.md b/In-app-notifications.md index a1bbad5e..9ab032cf 100644 --- a/In-app-notifications.md +++ b/In-app-notifications.md @@ -2,6 +2,7 @@ - [Full-featured In-App notifications](#full-featured-in-app-notifications) * [Send notification](#send-notification) * [Handling tap on In-App notification](#handling-tap-on-in-app-notification) + * [Additional notes](#additional-notes) - [Basic In-App notifications](#basic-in-app-notifications) * [Usage](#usage) * [Send notification](#send-notification-1) @@ -16,9 +17,31 @@ In-app messages are a type of communication tool with mobile users that includes [Read more documentation](https://www.infobip.com/docs/mobile-app-messaging/send-in-app-message) # Full-featured In-App notifications -Feature is available since [9.0.0-rc](https://github.com/infobip/mobile-messaging-sdk-android/releases/tag/9.0.0-rc) version. +Feature is available since [9.0.0](https://github.com/infobip/mobile-messaging-sdk-android/releases/tag/9.0.0) version. ->Notice: Javascript is enabled for the webView for this feature to work properly. [Disable In-App notifications](Notification-settings#modal-in-app-notifications) +## Enabling Full-featured In-Apps + +Full-featured In-App notifications are disabled by default, and in order to enable them, you need to call `.withFullFeaturedInApps()`. Without calling this method, Full-featured In-App notifications will trigger broadcast event MESSAGE_RECEIVED, but will not be displayed within WebView. +>### Notice +>Enabling this feature also enables JavaScript execution on the webView for the feature proper work + +```kotlin + MobileMessaging.Builder(application) + .withFullFeaturedInApps() + .build() +``` + +
expand to see Java code +

+ +```java +new MobileMessaging.Builder(application) + .withFullFeaturedInApps() + .build(); +``` + +

+
## Send notification After Mobile Messaging SDK is integrated into your app, you just need to create a Flow in [Infobip Customer Portal](https://portal.infobip.com/communications/flow/create?createdFrom=0), choose "Send Push or In-App notification" element and select "In-App notification", In-app notification Editor will be opened, where you can create In-app notification according to your preferences. @@ -49,6 +72,17 @@ Additionally, MobileMessaging SDK will trigger: - [notificationTapped](https://github.com/infobip/mobile-messaging-sdk-android/wiki/Library-events#notification_tapped) event if user tapped the banner In-App notification - [notificationActionTapped](https://github.com/infobip/mobile-messaging-sdk-android/wiki/Library-events#notification_action_tapped) event if user tapped an action button of the Pop-up or Fullscreen notification + +## Additional notes + +- If you do not enable feature, or use older versions of Mobile Messaging SDK, without this feature support, this type of messages will be received, but will not be displayed. Broadcast event MESSAGE_RECEIVED will be triggered. + + +- For Full-featured In-App messages, `Message` object in the field `body` contains text "In-App", for the technical reasons, but this field won't be involved in process of the displaying In-App notification in the WebView. + + +- For Full-featured In-App messages, `Message` object in the field `silent` will be always set as "true" + # Basic In-App notifications In-app notifications are alerts shown in foreground when user opens the app. [Modal](#modal) supported since 1.13.0. [Banner](#banner) supported since 2.0.0, [Huawei SDK 1.0.0](https://github.com/infobip/mobile-messaging-sdk-huawei). diff --git a/Migration-guide.md b/Migration-guide.md index e13d1f84..2087adda 100644 --- a/Migration-guide.md +++ b/Migration-guide.md @@ -10,7 +10,19 @@ ## Migration from `8.x` to `9.x` -[Full-Featured In-App notifications](In-app-notifications#full-featured-in-app-notifications) are supported since [9.0.0-rc](https://github.com/infobip/mobile-messaging-sdk-android/releases/tag/9.0.0-rc) version, Javascript is enabled for the webView for this feature to work properly, but it's possible to [Disable In-App notifications](In-app-notifications#disable-in-app-notifications). +Added support for the [Full-Featured In-App notifications](In-app-notifications#full-featured-in-app-notifications). This feature is disabled by default, check [Enabling Full-featured In-Apps](In-app-notifications#enabling-full-featured-in-apps). +> **Notice:** If you enabled the Full-features In-App feature, JavaScript will be enabled for the webView. + +### Changes for the in-app notifications + +- Original `InAppView` was renamed to `InAppNativeView`. +```java +//old +void buttonPressedFor(@NonNull InAppView inAppView, @NonNull Message message, NotificationCategory category, @NonNull NotificationAction action); + +//new +void buttonPressedFor(@NonNull InAppNativeView inAppView, @NonNull Message message, NotificationCategory category, @NonNull NotificationAction action); +``` ## Migration from `7.x` to `8.x` Starting from [8.0.0](https://github.com/infobip/mobile-messaging-sdk-android/releases/tag/8.0.0) version, we introduced new possibilities in `InAppChat` integration and customization. Also few dependencies are needed, if you do not have them already, when you include library as @aar: