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.

  1. Open the Firebase console.

  2. Click "CREATE NEW PROJECT".

  3. The "Create a project" window opens.

    Enter the following information and click "CREATE PROJECT".

    • Project name
      Enter Hello ThingIF. This is the project name of your app in the Firebase console.
    • Country/region
      Select your location. Hover on the "?" mark to display the description.

  4. The start screen of the Firebase console opens.

    Click "Add Firebase to your Android app".

  5. 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.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 instruction.

    Click "ADD APP" after specifying the app details.

  6. 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.
  7. 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.

Setting the server key

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.


If you want to learn more...