Flutter: FCM 푸쉬 알림

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


iOS Setup

  1. XCode에서 Targets — Runner — Signing & Capabilities에서 + 를 클릭하여 Push Notification을 추가합니다. Background Mode도 추가하여 Background fetch 와 Remote notification을 추가합니다.

Android Setup

android:value="high_importance_channel" />

Initialize Firebase

flutter pub add firebase_messaging
flutter pub add firebase_core
flutter pub add flutter_local_notifications
void main() async {
await FirebaseService.initializeFirebase();
runApp(const MyApp());

Get/Check Device Token

Future<String?> getDeviceToken() async => await FirebaseService.firebaseMessaging.getToken();

Receiving Notification

When App is in the Foreground — Android

void init() {
WidgetsBinding.instance.addPostFrameCallback((_) {

When App is in the Background (Android) & When App is in Foreground/Background (iOS)

When App is Terminated


"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