Created
May 4, 2021 15:03
-
-
Save PeterHdd/c1a0e2661dff23757397d82609c8d079 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FirebaseMessaging.onMessage.listen((RemoteMessage event) { | |
print("message recieved"); | |
print(event.notification!.body); | |
showDialog( | |
context: context, | |
builder: (BuildContext context) { | |
return AlertDialog( | |
title: Text("Notification"), | |
content: Text(event.notification!.body!), | |
actions: [ | |
TextButton( | |
child: Text("Ok"), | |
onPressed: () { | |
Navigator.of(context).pop(); | |
}, | |
) | |
], | |
); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment