Created
May 4, 2021 15:04
-
-
Save PeterHdd/5f781f8bf0dfb5c16de60e6f4f5b43ee 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
Future<void> _messageHandler(RemoteMessage message) async { | |
print('background message ${message.notification!.body}'); | |
} | |
void main() async { | |
WidgetsFlutterBinding.ensureInitialized(); | |
await Firebase.initializeApp(); | |
FirebaseMessaging.onBackgroundMessage(_messageHandler); | |
runApp(MessagingTutorial()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment