share a screenshot of your console
Can you show me a sample code about it?
_fcm.configure( onMessage: (Map message) async { print("onMessage: $message"); showDialog( context: context, builder: (context) => AlertDialog( content: ListTile( title: Text(message['notification']['title']), subtitle: Text(message['notification']['body']), ), actions: [ FlatButton( child: Text('Ok'), onPressed: () => Navigator.of(context).pop(), ), ], ), ); }, onLaunch: (Map message) async { print("onLaunch: $message"); // TODO optional }, onResume: (Map message) async { print("onResume: $message"); // TODO optional }, );
Where i put these stuff?!!
in your home page initstate method
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
share a screenshot of your console
Can you show me a sample code about it?
_fcm.configure(
onMessage: (Map message) async {
print("onMessage: $message");
showDialog(
context: context,
builder: (context) => AlertDialog(
content: ListTile(
title: Text(message['notification']['title']),
subtitle: Text(message['notification']['body']),
),
actions: [
FlatButton(
child: Text('Ok'),
onPressed: () => Navigator.of(context).pop(),
),
],
),
);
},
onLaunch: (Map message) async {
print("onLaunch: $message");
// TODO optional
},
onResume: (Map message) async {
print("onResume: $message");
// TODO optional
},
);
Where i put these stuff?!!
in your home page initstate method