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

来源:互联网 发布:2016家具淘宝数据 编辑:程序博客网 时间:2024/06/11 13:44

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”.
这里写图片描述
b. As the Picture shows below, you can create a new project.
这里写图片描述
这里写图片描述
3. Configure you project information in the google fcm server.
a. Fill in application Id and SHA1.
这里写图片描述
applicationId:
这里写图片描述
SHA1:
The link https://developers.google.com/android/guides/client-auth shows how to check SHA1.
4. Put FCM configs to your 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.
这里写图片描述
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.
这里写图片描述
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.
这里写图片描述
这里写图片描述
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:
这里写图片描述这里写图片描述

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

阅读全文
0 0
原创粉丝点击