天天看點

Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project

Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project

First of All, you should make sure that your network of your personal computer is ok. And you have already Set network proxy (or VPN) for it.

1. Apply for a Google developer account.

2. Go to https://console.firebase.google.com/ and apply for a FCM project.

a. If you have already created google project before, please “Import Google Project”, else you should “Add Project”. Let’s add a new project. Just Click “Add Project”.

Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project

b. As the Picture shows below, you can create a new project.

Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project
Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project

3. Configure you project information in the google fcm server.

a. Fill in application Id and SHA1.

Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project

applicationId:

Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project

SHA1:

The link https://developers.google.com/android/guides/client-auth shows how to check SHA1.

4. Put FCM configs to your android project.

Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project

a. Download Google Play Service SDK for your project using Android SDK Manager.

b. Download google-services.json.

c. Switch your project file to the project view in the android studio.

d. Put google-services.json to the path “project/app/..”.

5. Put FCM SDK to the project.

Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project

The link https://firebase.google.com/docs/cloud-messaging/android/client?authuser=0 shows the steps to put the FCM SDK to your project.

Since you have finished all the steps above, you can now send push notification message by Google FCM platform, and receive the message in your app.

Let us take a look at how to send and receive msg.

6. When you build the project added FCM, you install and open it in your android mobile, you will get a device token from google. Such as :

“cews6-oHPMQ:APA91bEas_LUZFej5kexFxjiuYxSPfIDbD9Q7TcPtCGdb0rot6kSaVwYjSDw3w3kadovBRxpZ4fbJ5W1p0_mMXqQtUU_ywO8MfQY5kumtD1r5AcNme-63xb4TkzbckAp1ByH0khgfPg7”. Save it and it will be used to send push notification to single device.

Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project

7. Since you get the token, you can send single test message with it, let us have a look at how to send PN message.

Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project
Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project

As the pictures shown above, you only need to step by step do it.

8. Message sent ? OK, let us check a check the app in your mobile, you can see that like below:

Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project
Apply for Google FCM ( Firebase Cloud Message ) Project & Configure Android Project

Could you also see this in your side ? Congratulations! You have already add the Google FCM to your project.