Skip to content

Instantly share code, notes, and snippets.

class Navigate {
static Map<String, Widget Function(BuildContext)> routes = {
'/' : (context) => WelcomePage(),
'/sign-in' : (context) => SignInPage(),
'/home' : (context) => HomePage()
};
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: Constants.title,
initialRoute: '/',
routes: Navigate.routes,
theme: ThemeData(
primarySwatch: Colors.blue,
void main() async{
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}

PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)

> Task :app:signingReport
Variant: debug
Config: debug
Store: /Users/peter/.android/debug.keystore
Alias: AndroidDebugKey
MD5: <md5-key>
SHA1: <sha1-key>
SHA-256: <sha256-key>
Valid until: Tuesday, December 1, 2048
cd android
./gradlew signingReport
POST https://fcm.googleapis.com/fcm/send
Authoritzation key="your_server_key"
{
"registration_ids": ["device_token"],
"notification": {
"title": "FCM",
"body": "messaging tutorial"
},
"data": {
FirebaseMessaging.onMessage.listen((RemoteMessage event) {
print("message recieved");
print(event.notification!.body);
print(event.data.values);
POST https://fcm.googleapis.com/fcm/send
Authoritzation key="your_server_key"
{
"to": "/topics/messaging",
"notification": {
"title": "FCM",
"body": "messaging tutorial"
},
"data": {
messaging.unsubscribeFromTopic("messaging");