Enabling the Kii Push Notification Feature with FCM
Follow the steps in this topic to use FCM push notification in the mobile app of Hello Thing-IF.
Creating a Firebase project
Follow the steps below.
Open the Firebase console.
Click "Create a project".
The "Create a project" window opens.
Enter the following information to create a new project.
- Project name
EnterHello ThingIF
. This is the project name of your app in the Firebase console.
- Project name
The project overview page opens.
Creating an Android app and getting the private key
Follow the steps below.
Click the Android icon to start adding an Android app.
The "Add Firebase to your Android app" screen opens.
Enter the package name of the mobile app. Specify the package name specified when you created the project in Android Studio. It is
com.kii.sample.hellothingif
in this tutorial.You can omit the app nickname and the debug signing certificate SHA-1 if you use only the FCM feature. Otherwise, follow the on-screen instructions.
Click "Register app" to continue.
Continue the configuration by following the on-screen instructions.
- Perss the "Download google-services.json" button to download the google-services.json file to your machine. You will set up the google-services.json file in Android Studio.
- Ignore the instructions to modify the build.gradle file. The file included in the Hello Thing-IF sample is ready to use.
On the project overview page, you will now see the
com.kii.sample.hellothingif
in the app list.Select the app and click the gear icon to open the project setting screen.
On the project setting screen, follow the steps below:
- Select the "Service accounts" tab
- Press the "Generate new private key"
The confirmation screen shows up. Press the "Generate key" button to download the private key.
Setting the private key
Now you will register the FCM private key on the Kii Cloud developer portal.
Open the Kii Cloud developer portal (http://developer.kii.com) and configure your application.
On the application console, click the "Edit" icon.
Select "PUSH NOTIFICATIONS". On the Push Notifications screen, choose and upload the private key file in the "FCM Settings - Service account key" section.
When you are done, press the "SAVE" button.
If you set both GCM and FCM settings, the FCM push notification will be enabled.
If you want to learn more...
- See Android (FCM) Push Notification Tutorial to learn how to set up FCM in a new project.