본문 바로가기

Flutter

Firebase Cloud Messaging(FCM) 구현 - 1

본 포스팅에서는 Flutter에서 Fcm의 구현을 다루고자 합니다.

알림 메시지, 데이터 메시지에 대한 내용을 모르시는 분은 이전 포스팅을 참고 부탁드립니다.

 

Firebase Cloud Messaging(FCM)

회사에서 업무중 FCM를 이용한 푸시를 구현하는 중 개념을 정리하고자한다. 클라이언트의 상태는 3가지로 나뉜다 1. 포그라운드 --> 앱이 켜져있는 상태 앱이 화면 앞단에 위치하고 있는 상태 2.

beomsuong.tistory.com

 

 

 

 

 

firebase_messaging | Flutter package

Flutter plugin for Firebase Cloud Messaging, a cross-platform messaging solution that lets you reliably deliver messages on Android and iOS.

pub.dev

 

 

flutter_local_notifications | Flutter package

A cross platform plugin for displaying and scheduling local notifications for Flutter applications with the ability to customise for each platform.

pub.dev

 

Fcm를 수신하기 위해 Firebase_messaing과 Flutter_local_notifications가 필요합니다.

Ios와 Android에 추가적인 설정 및 IOS 개발자 계정 셋팅등은 참고할 자료들이 많아 따로 설명하지는 않겠습니다.

 

 

여기서 중요한 것은 알림 메시지로 메시지를 수신할 경우 경우 백그라운드에서 자동으로 푸시가 표시되기 때문에 푸시에 대한 커스터마이징이 제한됩니다.  따라서 저 처럼 푸시 알림으로 사용자의 앱 화면을 이동시키거나 푸시 알림 디자인에 커스텀이 필요한 경우 반드시 데이터 메시지로 수신해야 합니다.

 

다음 글에서 코드를 추가 첨부하도록 하겠습니다.