Skip to content

Commit

Permalink
Pull request #38: Full-featured In-Apps
Browse files Browse the repository at this point in the history
Merge in MML/infobip-mobile-messaging-android.wiki from ikresic-MM-5974-android-sdk-release-9.0.0-version-with-full-featured-in-apps to master

Squashed commit of the following:

commit 2c1c0694fac94cdb990c6c36941a04e13c1dc73c
Author: ikresic <[email protected]>
Date:   Thu Sep 28 15:57:44 2023 +0200

    - updated docs

commit 3b53d4d89af6b30f12b70a8683c1c38de79a4a0a
Author: ikresic <[email protected]>
Date:   Thu Sep 28 09:42:08 2023 +0200

    - updated docs

commit dc7b6f90f1afe9347a2dea1be2b3c0ac44493680
Author: ikresic <[email protected]>
Date:   Wed Sep 27 14:02:09 2023 +0200

    - updated docs

commit 4d3e792e780a8958899b382c3037e666c0424069
Author: ikresic <[email protected]>
Date:   Wed Sep 27 13:26:35 2023 +0200

    - updated version number

commit f556f4a2afaeb131a5f3ed702f038bec59920d7c
Author: ikresic <[email protected]>
Date:   Wed Sep 27 12:35:49 2023 +0200

    - updated version number

commit 33077538d4b603d10bc95b378c3ca65e9fee53a9
Author: ikresic <[email protected]>
Date:   Tue Sep 26 17:04:48 2023 +0200

    - updated version number

commit f6bf2de3fb66d282312efee9c03264ba0cf514cd
Author: ikresic <[email protected]>
Date:   Tue Sep 26 16:57:42 2023 +0200

    - updated docs about Full-featured In-Apps

commit 855666fa51b9aa144298e23f7fa4fb2f241c5307
Author: ikresic <[email protected]>
Date:   Tue Sep 26 16:54:10 2023 +0200

    - updated docs about Full-featured In-Apps

commit dd47280ced7ae16004e812a70e1c05eba44c0373
Author: ikresic <[email protected]>
Date:   Tue Sep 26 15:10:12 2023 +0200

    - updated docs about Full-featured In-Apps
  • Loading branch information
ikresicc committed Sep 28, 2023
1 parent 309ad5b commit 5b9adbc
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
38 changes: 36 additions & 2 deletions In-app-notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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()
```

<details><summary>expand to see Java code</summary>
<p>

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

</p>
</details>

## 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.
Expand Down Expand Up @@ -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).

Expand Down
14 changes: 13 additions & 1 deletion Migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5b9adbc

Please sign in to comment.