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.
Follow the steps below.
Open the Firebase console.
Click "CREATE NEW PROJECT".
The "Create a project" window opens.
Enter the following information and click "CREATE PROJECT".
- Project name
Hello ThingIF. This is the project name of your app in the Firebase console.
Select your location. Hover on the "?" mark to display the description.
- Project name
The start screen of the Firebase console opens.
Click "Add Firebase to your Android app".
The "Enter app details" screen opens.
Enter the package name of the mobile app here. Specify the package name specified when you created the project in Android Studio. It is
com.kii.sample.hellothingifin 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 instruction.
Click "ADD APP" after specifying the app details.
Continue the configuration by following the on-screen instruction.
- The "Copy config file" screen downloads the google-services.json file to your machine as soon as the screen opens. You will set up the google-services.json file in Android Studio.
- Ignore the instruction to modify the build.gradle file. The file included in the Hello Thing-IF sample is ready to use.
Check the server key after the project is created.
First, select "Settings" from the project menu to open the "Settings" screen.
Open the "CLOUD MESSAGING" tab in the "Settings" screen.
Record the string displayed as the server key somewhere. We will enter this string in the developer portal of Kii Cloud in the next step.
Now you will register the FCM server key on the Kii Cloud developer portal.
Enter the server key in the GCM Settings section as Kii Cloud does not distinguish between FCM and GCM.
Open the Kii Cloud developer portal (http://developer.kii.com) and configure your application.
On the application console, click the "Edit" icon.
Now Select "PUSH NOTIFICATIONS". On the Push Notifications screen, enter the server key in the "GCM Key" field.
When you are done, press the "SAVE" button.
- See Android (FCM) Push Notification Tutorial to learn how to set up FCM in a new project.