Код: Выделить всё
$ dart pub global activate flutterfire_cli
$ flutterfire configure --project=
Код: Выделить всё
$ flutter pub add firebase_core
$ flutter pub add firebase_analytics
Код: Выделить всё
void main() async{
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
}
Код: Выделить всё
...
static FirebaseAnalytics analytics = FirebaseAnalytics.instance;
...
@override
Widget build(BuildContext context) {
analytics.logAppOpen();
Код: Выделить всё
Missing google_app_id. Firebase Analytics disabled. See https:...
Код: Выделить всё
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.23" apply false
id 'com.google.gms.google-services' version '4.4.1' apply false
}
Код: Выделить всё
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
id 'com.google.gms.google-services'
}
...
flutter {
source '../..'
}
dependencies {
implementation platform('com.google.firebase:firebase-bom:32.8.0')
implementation 'com.google.firebase:firebase-analytics'
}
Код: Выделить всё
"client": [
{
"client_info": {
"mobilesdk_app_id": "X:XXXXXXXXX:android:XXXXXXXXXXXXX",
"android_client_info": {
"package_name": "XXX.XXXXXXXX.XXXXXX"
}
},
Github
и
stackoverflow
Подробнее здесь: https://stackoverflow.com/questions/782 ... gle-app-id
Мобильная версия