Не удалось получить токен: SERVICE_NOT_AVAILABLE. Повторно попытаемся получить токен ⇐ Android
-
Гость
Не удалось получить токен: SERVICE_NOT_AVAILABLE. Повторно попытаемся получить токен
void main() async{ WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform ); final _firebaseMessaing = FirebaseMessaging.instance; await _firebaseMessaing.requestPermission(); final fCMToken = await _firebaseMessaing.getToken(); print("This is token =========> ${fCMToken}"); runApp(MyApp()); } Here I want the token but some errors occurs and the Token does not print. Not getting why I am facing this problem?
Unhandled Exception: [firebase_messaging/unknown] java.io.IOException: SERVICE_NOT_AVAILABLE E/flutter (17731): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7) E/flutter (17731): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18) E/flutter (17731): E/flutter (17731): #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:522:43) E/flutter (17731): E/flutter (17731): #3 MethodChannelFirebaseMessaging.getToken
Источник: https://stackoverflow.com/questions/781 ... -retrieval
void main() async{ WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform ); final _firebaseMessaing = FirebaseMessaging.instance; await _firebaseMessaing.requestPermission(); final fCMToken = await _firebaseMessaing.getToken(); print("This is token =========> ${fCMToken}"); runApp(MyApp()); } Here I want the token but some errors occurs and the Token does not print. Not getting why I am facing this problem?
Unhandled Exception: [firebase_messaging/unknown] java.io.IOException: SERVICE_NOT_AVAILABLE E/flutter (17731): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:651:7) E/flutter (17731): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:322:18) E/flutter (17731): E/flutter (17731): #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:522:43) E/flutter (17731): E/flutter (17731): #3 MethodChannelFirebaseMessaging.getToken
Источник: https://stackoverflow.com/questions/781 ... -retrieval
Мобильная версия