-
Notifications
You must be signed in to change notification settings - Fork 11
Interactive notifications
Interactive notifications are push notifications that provide an option for end user to interact with application through button tap action. This interaction can be accomplished by using Mobile Messaging SDK predefined interactive notification categories or creating your own.
Tapping the action should trigger actionTapped
event where you can act upon the received action identifier.
Mobile Messaging SDK provides only one predefined interaction category for now, but this list will be extended in the future.
Displaying of Interactive Notifications with predefined categories can be tested without any additional implementation on application side through Push API.
A = action
Category.id | A.id | A.title | A.foreground | A.authenticationRequired | A.destructive | A.moRequired |
---|---|---|---|---|---|---|
mm_accept_decline | mm_accept | Accept | true | true | false | true |
mm_decline | Decline | false | true | true | true |
Interactive notifications should be registered at the SDK initialization step by providing notificationCategories
configuration:
import 'package:infobip_mobilemessaging/models/configurations/configuration.dart' as mmconf;
await InfobipMobilemessaging.init(
mmconf.Configuration(
applicationCode: 'your-application-code',
androidSettings: ...,
iosSettings: ...,
notificationCategories: [
mmconf.NotificationCategory(
/// Unique identifier of the notification category
identifier: 'category_1',
/// A list of actions that a custom interactive notification category may consist of
actions: [
mmconf.NotificationAction(
/// Unique identifier of the notification action
identifier: 'notif_action_1',
/// An action title, represents a notification action button label
title: 'cancel',
/// To bring the app to foreground or leave it in background state
foreground: true,
/// Custom input field placeholder
textInputPlaceholder: 'placeholder',
/// To trigger MO message sending
moRequired: true,
/// iOS only: require device to be unlocked before performing
authenticationRequired: true,
/// iOS only: should message be marked as destructive
destructive: true,
/// iOS only: custom label for sending button
textInputActionButtonTitle: 'custom-ios-label',
// Android only: resource name for the special action icon
icon: 'res/...',
),
],
),
],
),
);
Platform specific details can be found at Android wiki and iOS wiki.
- Library events
- Server errors
- Users and installations
- Messages and notifications management
- Inbox
- Privacy settings
- In-app chat
- WebRTC Calls and UI
- Migration Guides
- JSON Web Token (JWT) structure and generation example