Skip to content

A Simple Plugin that creates an android conversation shortcut for messaging style notifications, so that the notification will be displayed in the Conversations part of the notifications

License

Notifications You must be signed in to change notification settings

ai8zr9/flutter_android_conversation_shortcut

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flutter_android_conversation_shortcut

A Simple Plugin that creates an android conversation shortcut for messaging style notifications, so that the notification will be displayed in the Conversations part of the notifications.
This plugin is intended as an enhancement to flutter_local_notifications.

Usage:

Create a person object from the flutter_local_notification plugin's Person class

Person person = Person(
  key: '1',
  name: 'Bob',
  icon: ...,
  ...
);

Then create the shorcut with the provided function:

final shortcutId = await AndroidConversationShortcut.createConversationShortcut(person);

flutter_local_notifications provides an attribute for AndroidNotificationDetails that let's you specify the shortcutId. Additionally the styleInformation has to be a MessagingStyleInformation object:

AndroidNotificationDetails(
  channel.id,
  channel.name,
  channel.description,
  icon: '@drawable/is_notification',
  shortcutId: shortcutId,
  styleInformation: MessagingStyleInformation(
    person,
    groupConversation: false,
    messages: messages,
    ...
  ),
  ...
);

About

A Simple Plugin that creates an android conversation shortcut for messaging style notifications, so that the notification will be displayed in the Conversations part of the notifications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published