onTokenRefresh

open fun onTokenRefresh(token: String)

Notifies Pushwoosh when Firebase Cloud Messaging token is refreshed.

CRITICAL: Call this method from your custom onNewToken callback to forward the new FCM token to Pushwoosh. Without this call, Pushwoosh will NOT be able to send notifications to the device after token refresh. Example:



public void onNewToken(@NonNull String token) {
    super.onNewToken(token);

    // CRITICAL: Forward token to Pushwoosh
    PushwooshFcmHelper.onTokenRefresh(token);
}

Parameters

token

new Firebase Cloud Messaging token

See also

FirebaseMessagingService#onNewToken(String)