Skip to main content

FCM Registration

Overview#

This document describes how to configure the push notification feature in the GCCS authentication process.


Feature Description#

There can be circumstances when the user requests GCCS authentication from a non-mobile platform such as the web or window.
To receive the push notification in the mobile app that has implemented the iOS SDK, FCM registration and the token update is necessary.

FCM Server key#

In order to receive the push notifications, the server key generated by Firebase Cloud Messaging (FCM) must be sent together with the client issuance request. The FCM server key can be found in the process below.

  1. Create or load the project in the Firebase Console.
  2. [Project Settings] > get the Server Key from [Cloud Messaging] menu.

If the client needs registration, note that the FCM server key is indispensable.

FCM Push notification token registration#

FCM push token should be registered so that it can be used for notifying authentication request. By using the requestTokenUpdate() from GuardianSdk, the FCM push token that was generated from the iOS device can be called to be registered and updated.

FCM push token can be changed due to expiration, etc. It should be updated by calling requestTokenUpdate().

Parameter#

KeyValueDescription
tokenStringFCM push notification token

Example#

// FCM Push notification token registeredGuardianService.sharedInstance.requestTokenUpdate(token: fcmToken!) { rtCode, rtMsg in    ...    } onFailed: { errCode, errMsg in    ...    }

TokenResponse#

KeyValueDescription
rtCode0Result code
rtMsgStringResult message

If the API call to register FCM push token is successful, the rtCode will be 0

ErrorResult#

KeyValueDescription
errorCodeIntError code
errorMessageStringError message

If API call fails, the user will receive an errorCode