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 a project".

  3. The "Create a project" window opens.

    Enter the following information to create a new project.

    • Project name
      Enter Hello ThingIF. This is the project name of your app in the Firebase console.

  4. The project overview page opens.

Creating an Android app and getting the private key

Follow the steps below.

  1. Click the Android icon to start adding an Android app.

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

  3. 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.
  4. 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.

  5. On the project setting screen, follow the steps below:

    1. Select the "Service accounts" tab
    2. Press the "Generate new private key"

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

  1. On the application console, click the "Edit" icon.

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