firebaseToken static method

Future<void> firebaseToken(
  1. String value
)

Sends a Firebase token with the specified value.

This method invokes the native method fcm_token.

Throws a PlatformException if sending the token fails.

value: The Firebase Cloud Messaging token to send.

Implementation

static Future<void> firebaseToken(String value) async {
  const platform = MethodChannel('mergnKotlinSDK');
  try {
    await platform.invokeMethod('fcm_token', {"token": value});
  } on PlatformException catch (e) {
    print("Failed to send token: '${e.message}'.");
  }
}