Flutter: FCM 푸쉬 알림

Notification눌른 다음 다른 화면으로 Push하려면?

https://firebase.google.com/docs/cloud-messaging
XCode
<meta-data
android:name="com.google.firebase.messaging.default_notification_channel_id"
android:value="high_importance_channel" />
flutter pub add firebase_messaging
flutter pub add firebase_core
flutter pub add flutter_local_notifications
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await FirebaseService.initializeFirebase();
runApp(const MyApp());
}
Future<String?> getDeviceToken() async => await FirebaseService.firebaseMessaging.getToken();
@override
void init() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
FCMProvider.setContext(context);
});
}
"apns: { 
"payload": {
"aps": {
"sound": default
}
}
}

--

--

Flutter & Node.js Full-Stack Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store