getInitialMessage method
Reads the info key included in a Push Notification when opening the app
by tapping on it.
Example Usage
function someAsyncFunction() async {
final message = await PusherBeams.instance.getInitialMessage();
}
In order to receive data the published payload must contain an info key
in the data key:
{
"interests":["hello"],
"apns": {
"aps": {
"alert": {"title":"Hello", "body":"Hello, world!"},
},
"data": {
"info": { "name": "george" }
}
},
"fcm": {
"notification": {"title":"Hello", "body":"Hello, world!"},
"data": {
"info": { "name": "george" }
}
}
}
Throws an Exception in case of failure.
Implementation
@override
Future<Map<String, dynamic>?> getInitialMessage() async {
return await _pusherBeamsApi.getInitialMessage();
}