Sample of Kii-FCM integration. GCM (Google Cloud Messaging) has been moved to FCM. This Sample porject shows
- How to migrate GCM based Kii Cloud application to FCM.
- How to start Kii Cloud application with FCM integration
Edit Config.java And enter you Kii Cloud app information. (App ID, App Key, Site can be confirmed on Kii Developer console.)
- Sign up/in to Firebase.
- Click "IMPORT GOOGLE PROJECT" and choose the Google project integrated with Kii CLoud.
- In the Project view, click "ADD APP" -> "Add Firebase to your Android app"
- Enter Packagename, optional signing certificate.
- Download config file (google-services.json) and place it in the root directory of the application.
- Run app and login with existing user, send push notification from Kii Developer Console. App shows notification with laucher icon (dorid icon) when recieved push.
- Sign up/in to Firebase.
- Click "CREATE NEW PROJECT".
- In the Project view, click "ADD APP" -> "Add Firebase to your Android app"
- Enter Packagename, optional signing certificate.
- Download config file (google-services.json) and place it in the root directory of the application.
- Check Project Setting -> "Cloud Messaging" Tab. Copy "Server Key" value.
- Go to Kii Developer Console and choose app. (If you haven't created app, please create app.)
- Save Server Key copied from Firebase console and as GCM Key in Notification settings. (Please see the guide how to set GCM Key in Kii Cloud Console.
- Run app and login with existing user, send push notification from Kii Developer Console. App shows notification with laucher icon (dorid icon) when recieved push.
When FCM token has been published or changed, Need to install it to Kii Cloud.
In Kii Cloud, FCM token is bound to KiiUser. When no user is sign up/in to Kii Cloud, Just store the token to SharedPreferences. If user is logged in, Upload it to Kii Cloud.
Implement Kii User sign in process. When the FCM token is stored in SharedPreference, update installation in Kii Cloud. It is necessary when the FCM token is published on initial app installation or KiiUser has been changed after the app installation.
Just shows simple notification when Recieved notification from Kii Cloud through FCM.