setExternalToken method

dynamic setExternalToken(
  1. String externalToken
)

Assigns an external token to enable client communication via external services while the client is offline.

Presuming a client goes offline and disconnects from the MigratoryData cluster. Then plugins within the MigratoryData server, leveraging MigratoryData's Presence API, can utilize this external token to communicate with the offline client, via external services like push notifications or email.

For instance, consider a plugin designed for Firebase Cloud Messaging (FCM), which requires an FCM token to send push notifications to a client via FCM. Through this method, the client can provide the necessary FCM token to the plugin.

Similarly, consider a plugin designed for email services. To send emails to clients when they're offline, the plugin requires their email addresses. Clients can provide their email addresses using this method.

\param externalToken a token (e.g. FCM token, email address, ...)

Implementation

setExternalToken(String externalToken) {
  clientImpl.setExternalToken(externalToken);
}