Skip to content

Interactive notifications

Alexander Boldyrev edited this page Jul 24, 2025 · 2 revisions

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.

Predefined categories

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

Custom categories

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.

Clone this wiki locally