Add firebase

This commit is contained in:
Anton Tananaev 2025-05-10 07:42:54 -07:00
parent 2724935bd0
commit 7315f4343c
7 changed files with 156 additions and 0 deletions

View file

@ -1,5 +1,8 @@
plugins {
id("com.android.application")
// START: FlutterFire Configuration
id("com.google.gms.google-services")
// END: FlutterFire Configuration
id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")

View file

@ -0,0 +1,38 @@
{
"project_info": {
"project_number": "39016471396",
"firebase_url": "https://traccar-client-app.firebaseio.com",
"project_id": "traccar-client-app",
"storage_bucket": "traccar-client-app.firebasestorage.app"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:39016471396:android:b1c7194c699bfa25",
"android_client_info": {
"package_name": "org.traccar.client"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyD5uSOXpbWkR8C3fqdNKQcI7BJrPObpeP4"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": [
{
"client_id": "39016471396-7mdutolor3h210bm9qmf60gp18lmmhnm.apps.googleusercontent.com",
"client_type": 2,
"ios_info": {
"bundle_id": "org.traccar.client.TraccarClient"
}
}
]
}
}
}
],
"configuration_version": "1"
}

View file

@ -19,6 +19,9 @@ pluginManagement {
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.7.0" apply false
// START: FlutterFire Configuration
id("com.google.gms.google-services") version("4.3.15") apply false
// END: FlutterFire Configuration
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
}

1
firebase.json Normal file
View file

@ -0,0 +1 @@
{"flutter":{"platforms":{"android":{"default":{"projectId":"traccar-client-app","appId":"1:39016471396:android:b1c7194c699bfa25","fileOutput":"android/app/google-services.json"}},"ios":{"default":{"projectId":"traccar-client-app","appId":"1:39016471396:ios:78cbbf5775b43308","uploadDebugSymbols":false,"fileOutput":"ios/Runner/GoogleService-Info.plist"}},"dart":{"lib/firebase_options.dart":{"projectId":"traccar-client-app","configurations":{"android":"1:39016471396:android:b1c7194c699bfa25","ios":"1:39016471396:ios:78cbbf5775b43308"}}}}}}

View file

@ -17,6 +17,7 @@
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
F301A0628B4B67129B4EF6BC /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF9CEA917E371A914E728FD9 /* Pods_Runner.framework */; };
F7404BADF18F0407F900F367 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C29E374AB4C3F885DE083543 /* Pods_RunnerTests.framework */; };
F7C3033B72F10E5D400E8620 /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 42DA49C4C866005273D03AF6 /* GoogleService-Info.plist */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -48,6 +49,7 @@
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
42DA49C4C866005273D03AF6 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
50797FECAA48F3999E66543E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@ -118,6 +120,7 @@
331C8082294A63A400263BE5 /* RunnerTests */,
DC5B6CE5A1B7DC8E9FC89129 /* Pods */,
F91A8C14E37051DCD5210011 /* Frameworks */,
42DA49C4C866005273D03AF6 /* GoogleService-Info.plist */,
);
sourceTree = "<group>";
};
@ -268,6 +271,7 @@
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
86ABD4FD2DCDB6B60041010B /* PrivacyInfo.xcprivacy in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
F7C3033B72F10E5D400E8620 /* GoogleService-Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View file

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CLIENT_ID</key>
<string>39016471396-7mdutolor3h210bm9qmf60gp18lmmhnm.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.39016471396-7mdutolor3h210bm9qmf60gp18lmmhnm</string>
<key>API_KEY</key>
<string>AIzaSyBEdxpKXTvJJfYDh28OLffAk4z7S7caf08</string>
<key>GCM_SENDER_ID</key>
<string>39016471396</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>org.traccar.client.TraccarClient</string>
<key>PROJECT_ID</key>
<string>traccar-client-app</string>
<key>STORAGE_BUCKET</key>
<string>traccar-client-app.firebasestorage.app</string>
<key>IS_ADS_ENABLED</key>
<false></false>
<key>IS_ANALYTICS_ENABLED</key>
<false></false>
<key>IS_APPINVITE_ENABLED</key>
<true></true>
<key>IS_GCM_ENABLED</key>
<true></true>
<key>IS_SIGNIN_ENABLED</key>
<true></true>
<key>GOOGLE_APP_ID</key>
<string>1:39016471396:ios:78cbbf5775b43308</string>
<key>DATABASE_URL</key>
<string>https://traccar-client-app.firebaseio.com</string>
</dict>
</plist>

71
lib/firebase_options.dart Normal file
View file

@ -0,0 +1,71 @@
// File generated by FlutterFire CLI.
// ignore_for_file: type=lint
import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
import 'package:flutter/foundation.dart'
show defaultTargetPlatform, kIsWeb, TargetPlatform;
/// Default [FirebaseOptions] for use with your Firebase apps.
///
/// Example:
/// ```dart
/// import 'firebase_options.dart';
/// // ...
/// await Firebase.initializeApp(
/// options: DefaultFirebaseOptions.currentPlatform,
/// );
/// ```
class DefaultFirebaseOptions {
static FirebaseOptions get currentPlatform {
if (kIsWeb) {
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for web - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
}
switch (defaultTargetPlatform) {
case TargetPlatform.android:
return android;
case TargetPlatform.iOS:
return ios;
case TargetPlatform.macOS:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for macos - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.windows:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for windows - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
case TargetPlatform.linux:
throw UnsupportedError(
'DefaultFirebaseOptions have not been configured for linux - '
'you can reconfigure this by running the FlutterFire CLI again.',
);
default:
throw UnsupportedError(
'DefaultFirebaseOptions are not supported for this platform.',
);
}
}
static const FirebaseOptions android = FirebaseOptions(
apiKey: 'AIzaSyD5uSOXpbWkR8C3fqdNKQcI7BJrPObpeP4',
appId: '1:39016471396:android:b1c7194c699bfa25',
messagingSenderId: '39016471396',
projectId: 'traccar-client-app',
databaseURL: 'https://traccar-client-app.firebaseio.com',
storageBucket: 'traccar-client-app.firebasestorage.app',
);
static const FirebaseOptions ios = FirebaseOptions(
apiKey: 'AIzaSyBEdxpKXTvJJfYDh28OLffAk4z7S7caf08',
appId: '1:39016471396:ios:78cbbf5775b43308',
messagingSenderId: '39016471396',
projectId: 'traccar-client-app',
databaseURL: 'https://traccar-client-app.firebaseio.com',
storageBucket: 'traccar-client-app.firebasestorage.app',
iosClientId: '39016471396-7mdutolor3h210bm9qmf60gp18lmmhnm.apps.googleusercontent.com',
iosBundleId: 'org.traccar.client.TraccarClient',
);
}