Android/FireBase

Firebase Clounding Message 구현 (1) - 기본적인 환경 구축

donghune 2019. 8. 5. 18:19

GCM이 멸망하고 FCM이 두둥탁!

간단하게 만들어 보는걸 해보도록 하겠습니다.


1. Firebase Project 생성 및 google-services.json 등록하기

별다른거 없이 프로젝트 이름 넣어주시구요

저희의 목적은 FCM이니 애널리틱스는 나중에

몇분 안걸리구 끝납니다.

제일 아래 있는 Cloud Messaging을 눌러주시고 중앙에 안드로이드 아이콘 클릭! 

정보를 쭉쭉 입력

google-services.json 파일 다운로드 후 등록

홈페이지에서 설정은 이제 끝났습니다.


2. Postman 설치하기

https://www.getpostman.com/

 

Postman | API Development Environment

Postman is the only complete API development environment used by more than 7 million developers and 300,000 companies worldwide.

www.getpostman.com

주소창으로는 저희가 POST를 날리지 못합니다. 그래서 POST를 날릴 수 있게 도와주는 Postman님을 설치해줍시다.


안드로이드 프로젝트 하나 생성해주시고 그레들 설정을 해줍시다.

buildscript {
    ...
    dependencies {
        ...
        classpath 'com.google.gms:google-services:4.3.0'
    }
}
...

apply plugin: 'com.google.gms.google-services'

android {
    ...
}

dependencies {
    ...
    // firebase
    implementation 'com.google.firebase:firebase-core:17.0.1'
    implementation 'com.google.firebase:firebase-firestore:20.2.0'
    implementation 'com.google.firebase:firebase-messaging:19.0.1'
}

이제 sync를 돌려보시면 정상적으로 되며 기본적인 셋팅은 끝나게 됩니다.

2편에서는 FCM 서비스를 구축해보도록 하겠습니다.