firebaseToken method
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
Future<void> firebaseToken(String value) async {
if(Platform.isAndroid){
try {
await methodChannel.invokeMethod('fcm_token', {"token": value});
} on PlatformException catch (e) {
print("Failed to send token: '${e.message}'.");
}
}}