Message Center

Airship Message Center is a place in your app where you can display persistent rich messages, including HTML, video, etc. The messages are hosted by Airship, and are typically displayed in standard inbox-style within your app.

To use the InboxMessageView on iOS, you will need to opt-in for the embedded views preview by adding a boolean property to your app's Info.plist file, with the key io.flutter.embedded_views_preview set to the valueYES.

Getting messages
List<InboxMessage> messages = await Airship.inboxMessages;
Deleting and marking messages read
Airship.markInboxMessageRead(messages[0]);
Airship.deleteInboxMessage(messages[0]);
Events
Airship.onInboxUpdated
    .listen((event) => debugPrint('Inbox updated'));

Airship.onShowInbox
    .listen((event) => debugPrint('Navigate to app's inbox'));

Airship.onShowInboxMessage
    .listen((messageId) => debugPrint('Navigate to message $messageId'));
Using the InboxMessageView
InboxMessage message = messages[0];

void onInboxMessageViewCreated(InboxMessageViewController controller) {
    controller.loadMessage(message);
}

@override
Widget build(BuildContext context) {
    return MaterialApp(
        home: Scaffold(
            appBar: AppBar(
            title: const Text('Message: $message.title'),
        ),
        body:  Container(
            child: InboxMessageView(onViewCreated: onInboxMessageViewCreated),
            height: 300.0,
        )
    ));
}