feat: Switch to firebase messaging package

krille/firebase-messaging
Krille 2 years ago committed by Christian Kußowski
parent 097f9f02a0
commit ab4fe415b1
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -25,8 +25,8 @@ jobs:
- name: Check license compliance - name: Check license compliance
run: dart run license_checker check-licenses -c licenses.yaml --problematic run: dart run license_checker check-licenses -c licenses.yaml --problematic
- run: flutter analyze - run: flutter analyze
- name: Add Firebase Messaging - name: Apply google services patch
run: ./scripts/add-firebase-messaging.sh run: ./scripts/enable-google-services.sh
- run: flutter analyze - run: flutter analyze
- run: flutter test - run: flutter test

@ -114,13 +114,6 @@
</intent-filter> </intent-filter>
</activity> </activity>
<service android:name=".FcmPushService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service android:name="com.pravera.flutter_foreground_task.service.ForegroundService" <service android:name="com.pravera.flutter_foreground_task.service.ForegroundService"
android:foregroundServiceType="camera|microphone|mediaProjection"> android:foregroundServiceType="camera|microphone|mediaProjection">
</service> </service>

@ -1,28 +0,0 @@
/*package chat.fluffy.fluffychat
import com.famedly.fcm_shared_isolate.FcmSharedIsolateService
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.embedding.engine.dart.DartExecutor.DartEntrypoint
import android.content.Context
class FcmPushService : FcmSharedIsolateService() {
override fun getEngine(): FlutterEngine {
return provideEngine(getApplicationContext())
}
companion object {
fun provideEngine(context: Context): FlutterEngine {
var engine = MainActivity.engine
if (engine == null) {
engine = MainActivity.provideEngine(context)
engine.getLocalizationPlugin().sendLocalesToFlutter(
context.getResources().getConfiguration())
engine.getDartExecutor().executeDartEntrypoint(
DartEntrypoint.createDefault())
}
return engine
}
}
}
*/

@ -6,12 +6,10 @@ import io.flutter.embedding.engine.FlutterEngine
import android.content.Context import android.content.Context
class MainActivity : FlutterActivity() { class MainActivity : FlutterActivity() {
override fun attachBaseContext(base: Context) { override fun attachBaseContext(base: Context) {
super.attachBaseContext(base) super.attachBaseContext(base)
} }
override fun provideFlutterEngine(context: Context): FlutterEngine? { override fun provideFlutterEngine(context: Context): FlutterEngine? {
return provideEngine(this) return provideEngine(this)
} }

@ -0,0 +1 @@
{"flutter":{"platforms":{"android":{"default":{"projectId":"fluffychat-ef3e8","appId":"1:865731724731:android:ec427b3b1dcd4a1e64309e","fileOutput":"android/app/google-services.json"}},"dart":{"lib/firebase_options.dart":{"projectId":"fluffychat-ef3e8","configurations":{"android":"1:865731724731:android:ec427b3b1dcd4a1e64309e","ios":"1:865731724731:ios:79fd983ce46cb40c64309e","macos":"1:865731724731:ios:6fb777cf513cdb6264309e","web":"1:865731724731:web:d367990bc625c24864309e","windows":"1:865731724731:web:06933086ac59630464309e"}}}}}}

@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project # Uncomment this line to define a global platform for your project
platform :ios, '13.0' platform :ios, '15.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'

@ -1,3 +1,7 @@
import 'package:firebase_core/firebase_core.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:fluffychat/utils/push_helper.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
@ -22,6 +26,8 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized(); WidgetsFlutterBinding.ensureInitialized();
await vod.init(wasmPath: './assets/assets/vodozemac/'); await vod.init(wasmPath: './assets/assets/vodozemac/');
await Firebase.initializeApp();
FirebaseMessaging.onBackgroundMessage(pushHelperBackground);
Logs().nativeColors = !PlatformInfos.isIOS; Logs().nativeColors = !PlatformInfos.isIOS;
final store = await SharedPreferences.getInstance(); final store = await SharedPreferences.getInstance();

@ -39,7 +39,7 @@ import '../config/setting_keys.dart';
import '../widgets/matrix.dart'; import '../widgets/matrix.dart';
import 'platform_infos.dart'; import 'platform_infos.dart';
//<GOOGLE_SERVICES>import 'package:fcm_shared_isolate/fcm_shared_isolate.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
class NoTokenException implements Exception { class NoTokenException implements Exception {
String get cause => 'Cannot get firebase token'; String get cause => 'Cannot get firebase token';
@ -64,7 +64,7 @@ class BackgroundPush {
final pendingTests = <String, Completer<void>>{}; final pendingTests = <String, Completer<void>>{};
//<GOOGLE_SERVICES>final firebase = FcmSharedIsolate(); final firebase = FirebaseMessaging.instance;
DateTime? lastReceivedPush; DateTime? lastReceivedPush;
@ -80,17 +80,7 @@ class BackgroundPush {
onDidReceiveNotificationResponse: goToRoom, onDidReceiveNotificationResponse: goToRoom,
); );
Logs().v('Flutter Local Notifications initialized'); Logs().v('Flutter Local Notifications initialized');
//<GOOGLE_SERVICES>firebase.setListeners( FirebaseMessaging.onMessage.listen(_onFirebaseMessage);
//<GOOGLE_SERVICES> onMessage: (message) => pushHelper(
//<GOOGLE_SERVICES> PushNotification.fromJson(
//<GOOGLE_SERVICES> Map<String, dynamic>.from(message['data'] ?? message),
//<GOOGLE_SERVICES> ),
//<GOOGLE_SERVICES> client: client,
//<GOOGLE_SERVICES> l10n: l10n,
//<GOOGLE_SERVICES> activeRoomId: matrix?.activeRoomId,
//<GOOGLE_SERVICES> flutterLocalNotificationsPlugin: _flutterLocalNotificationsPlugin,
//<GOOGLE_SERVICES> ),
//<GOOGLE_SERVICES>);
if (Platform.isAndroid) { if (Platform.isAndroid) {
await UnifiedPush.initialize( await UnifiedPush.initialize(
onNewEndpoint: _newUpEndpoint, onNewEndpoint: _newUpEndpoint,
@ -148,7 +138,7 @@ class BackgroundPush {
bool useDeviceSpecificAppId = false, bool useDeviceSpecificAppId = false,
}) async { }) async {
if (PlatformInfos.isIOS) { if (PlatformInfos.isIOS) {
//<GOOGLE_SERVICES>await firebase.requestPermission(); await firebase.requestPermission();
} }
if (PlatformInfos.isAndroid) { if (PlatformInfos.isAndroid) {
_flutterLocalNotificationsPlugin _flutterLocalNotificationsPlugin
@ -172,7 +162,7 @@ class BackgroundPush {
if (deviceAppId.length > 64) { if (deviceAppId.length > 64) {
deviceAppId = deviceAppId.substring(0, 64); deviceAppId = deviceAppId.substring(0, 64);
} }
if (!useDeviceSpecificAppId && PlatformInfos.isAndroid) { if (!useDeviceSpecificAppId) {
appId += '.data_message'; appId += '.data_message';
} }
final thisAppId = useDeviceSpecificAppId ? deviceAppId : appId; final thisAppId = useDeviceSpecificAppId ? deviceAppId : appId;
@ -308,7 +298,7 @@ class BackgroundPush {
Logs().v('Setup firebase'); Logs().v('Setup firebase');
if (_fcmToken?.isEmpty ?? true) { if (_fcmToken?.isEmpty ?? true) {
try { try {
//<GOOGLE_SERVICES>_fcmToken = await firebase.getToken(); _fcmToken = await firebase.getToken();
if (_fcmToken == null) throw ('PushToken is null'); if (_fcmToken == null) throw ('PushToken is null');
} catch (e, s) { } catch (e, s) {
Logs().w('[Push] cannot get token', e, e is String ? null : s); Logs().w('[Push] cannot get token', e, e is String ? null : s);
@ -385,8 +375,9 @@ class BackgroundPush {
Logs().i('[Push] UnifiedPush using endpoint $endpoint'); Logs().i('[Push] UnifiedPush using endpoint $endpoint');
final oldTokens = <String?>{}; final oldTokens = <String?>{};
try { try {
//<GOOGLE_SERVICES>final fcmToken = await firebase.getToken(); String? fcmToken;
//<GOOGLE_SERVICES>oldTokens.add(fcmToken); fcmToken = await firebase.getToken();
oldTokens.add(fcmToken);
} catch (_) {} } catch (_) {}
await setupPusher( await setupPusher(
gatewayUrl: endpoint, gatewayUrl: endpoint,
@ -413,11 +404,19 @@ class BackgroundPush {
} }
} }
Future<void> _onUpMessage(PushMessage pushMessage, String i) async { // ignore: unused_element
final message = pushMessage.content; Future<void> _onFirebaseMessage(message) => pushHelper(
PushNotification.fromJson(message.data),
client: client,
l10n: l10n,
activeRoomId: matrix?.activeRoomId,
flutterLocalNotificationsPlugin: _flutterLocalNotificationsPlugin,
);
Future<void> _onUpMessage(PushMessage message, String i) async {
upAction = true; upAction = true;
final data = Map<String, dynamic>.from( final data = Map<String, dynamic>.from(
json.decode(utf8.decode(message))['notification'], json.decode(utf8.decode(message.content))['notification'],
); );
// UP may strip the devices list // UP may strip the devices list
data['devices'] ??= []; data['devices'] ??= [];

@ -61,7 +61,10 @@ extension InitWithRestoreExtension on Client {
); );
} }
Future<void> initWithRestore({void Function()? onMigration}) async { Future<void> initWithRestore({
bool isBackgroundClient = false,
void Function()? onMigration,
}) async {
final storageKey = final storageKey =
'${AppConfig.applicationName}_session_backup_$clientName'; '${AppConfig.applicationName}_session_backup_$clientName';
final storage = PlatformInfos.isMobile || PlatformInfos.isLinux final storage = PlatformInfos.isMobile || PlatformInfos.isLinux
@ -69,6 +72,7 @@ extension InitWithRestoreExtension on Client {
: null; : null;
try { try {
if (isBackgroundClient) await abortSync();
await init( await init(
onInitStateChanged: (state) { onInitStateChanged: (state) {
if (state == InitState.migratingDatabase) onMigration?.call(); if (state == InitState.migratingDatabase) onMigration?.call();

@ -1,6 +1,7 @@
import 'dart:convert'; import 'dart:convert';
import 'dart:ui'; import 'dart:ui';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -19,13 +20,29 @@ import 'package:fluffychat/utils/platform_infos.dart';
const notificationAvatarDimension = 128; const notificationAvatarDimension = 128;
@pragma('vm:entry-point')
Future<void> pushHelperBackground(message) async {
await Firebase.initializeApp();
return pushHelper(PushNotification.fromJson(message.data));
}
Future<void> pushHelper( Future<void> pushHelper(
PushNotification notification, { PushNotification notification, {
Client? client, Client? client,
L10n? l10n, L10n? l10n,
String? activeRoomId, String? activeRoomId,
required FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin, FlutterLocalNotificationsPlugin? flutterLocalNotificationsPlugin,
}) async { }) async {
if (flutterLocalNotificationsPlugin == null) {
flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
await flutterLocalNotificationsPlugin.initialize(
const InitializationSettings(
android: AndroidInitializationSettings('notifications_icon'),
iOS: DarwinInitializationSettings(),
),
);
}
try { try {
await _tryPushHelper( await _tryPushHelper(
notification, notification,
@ -43,7 +60,7 @@ Future<void> pushHelper(
l10n.newMessageInFluffyChat, l10n.newMessageInFluffyChat,
l10n.openAppToReadMessages, l10n.openAppToReadMessages,
NotificationDetails( NotificationDetails(
iOS: const DarwinNotificationDetails(), iOS: const DarwinNotificationDetails(sound: 'notification.caf'),
android: AndroidNotificationDetails( android: AndroidNotificationDetails(
AppConfig.pushNotificationsChannelId, AppConfig.pushNotificationsChannelId,
l10n.incomingMessages, l10n.incomingMessages,
@ -278,7 +295,9 @@ Future<void> _tryPushHelper(
priority: Priority.max, priority: Priority.max,
groupKey: event.room.spaceParents.firstOrNull?.roomId ?? 'rooms', groupKey: event.room.spaceParents.firstOrNull?.roomId ?? 'rooms',
); );
const iOSPlatformChannelSpecifics = DarwinNotificationDetails(); const iOSPlatformChannelSpecifics = DarwinNotificationDetails(
sound: "notification.caf",
);
final platformChannelSpecifics = NotificationDetails( final platformChannelSpecifics = NotificationDetails(
android: androidPlatformChannelSpecifics, android: androidPlatformChannelSpecifics,
iOS: iOSPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics,

@ -13,6 +13,8 @@ import dynamic_color
import emoji_picker_flutter import emoji_picker_flutter
import file_picker import file_picker
import file_selector_macos import file_selector_macos
import firebase_core
import firebase_messaging
import flutter_local_notifications import flutter_local_notifications
import flutter_new_badger import flutter_new_badger
import flutter_secure_storage_macos import flutter_secure_storage_macos
@ -41,6 +43,8 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
EmojiPickerFlutterPlugin.register(with: registry.registrar(forPlugin: "EmojiPickerFlutterPlugin")) EmojiPickerFlutterPlugin.register(with: registry.registrar(forPlugin: "EmojiPickerFlutterPlugin"))
FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin")) FilePickerPlugin.register(with: registry.registrar(forPlugin: "FilePickerPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
FLTFirebaseCorePlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseCorePlugin"))
FLTFirebaseMessagingPlugin.register(with: registry.registrar(forPlugin: "FLTFirebaseMessagingPlugin"))
FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin"))
FlutterNewBadgerPlugin.register(with: registry.registrar(forPlugin: "FlutterNewBadgerPlugin")) FlutterNewBadgerPlugin.register(with: registry.registrar(forPlugin: "FlutterNewBadgerPlugin"))
FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin")) FlutterSecureStoragePlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStoragePlugin"))

@ -26,6 +26,7 @@
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; };
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; };
33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; };
3AF44CC3D61A8332019AFCDE /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 5AEFA815523969D4ADFBE7E8 /* GoogleService-Info.plist */; };
9CAF203E1D098383F2EDFFCB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3C62FEBAA272B5A33AFFC95 /* Pods_Runner.framework */; }; 9CAF203E1D098383F2EDFFCB /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3C62FEBAA272B5A33AFFC95 /* Pods_Runner.framework */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
@ -69,6 +70,7 @@
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; }; 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; }; 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
35E6B919318905352ECC7D69 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; }; 35E6B919318905352ECC7D69 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = "<group>"; };
5AEFA815523969D4ADFBE7E8 /* GoogleService-Info.plist */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "Runner/GoogleService-Info.plist"; sourceTree = "<group>"; };
5CDC3DD55F4AC23D2067B292 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; }; 5CDC3DD55F4AC23D2067B292 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
@ -110,6 +112,7 @@
33CC10EE2044A3C60003C045 /* Products */, 33CC10EE2044A3C60003C045 /* Products */,
D73912EC22F37F3D000D13A0 /* Frameworks */, D73912EC22F37F3D000D13A0 /* Frameworks */,
F9F203356080D460FB6D4567 /* Pods */, F9F203356080D460FB6D4567 /* Pods */,
5AEFA815523969D4ADFBE7E8 /* GoogleService-Info.plist */,
); );
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@ -255,6 +258,7 @@
files = ( files = (
33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */,
33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */,
3AF44CC3D61A8332019AFCDE /* GoogleService-Info.plist in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

@ -0,0 +1,30 @@
<?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>API_KEY</key>
<string>AIzaSyA8ZUBcuny0HjPwF2Q2fvDyQTC5dG2VHlE</string>
<key>GCM_SENDER_ID</key>
<string>865731724731</string>
<key>PLIST_VERSION</key>
<string>1</string>
<key>BUNDLE_ID</key>
<string>im.fluffychat.fluffychat</string>
<key>PROJECT_ID</key>
<string>fluffychat-ef3e8</string>
<key>STORAGE_BUCKET</key>
<string>fluffychat-ef3e8.appspot.com</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:865731724731:ios:6fb777cf513cdb6264309e</string>
</dict>
</plist>

@ -9,6 +9,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "67.0.0" version: "67.0.0"
_flutterfire_internals:
dependency: transitive
description:
name: _flutterfire_internals
sha256: bb84ee51e527053dd8e25ecc9f97a6abfdc19130fb4d883e4e8585e23e7e6dd8
url: "https://pub.dev"
source: hosted
version: "1.3.60"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
@ -473,6 +481,54 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.9.3+4" version: "0.9.3+4"
firebase_core:
dependency: "direct main"
description:
name: firebase_core
sha256: "6b343e6f7b72a4f32d7ce8df8c9a28d8f54b4ac20d7c6500f3e8b3969afca457"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
firebase_core_platform_interface:
dependency: transitive
description:
name: firebase_core_platform_interface
sha256: "5dbc900677dcbe5873d22ad7fbd64b047750124f1f9b7ebe2a33b9ddccc838eb"
url: "https://pub.dev"
source: hosted
version: "6.0.0"
firebase_core_web:
dependency: transitive
description:
name: firebase_core_web
sha256: "5d28b14dd32282fb7ce2b22b897362453755b6b8541d491127dc72b755bb7b16"
url: "https://pub.dev"
source: hosted
version: "3.0.0"
firebase_messaging:
dependency: "direct main"
description:
name: firebase_messaging
sha256: "10272b553a49c13a6cedfd00121047157521f82a5d3f2a1706b9dd28342cc482"
url: "https://pub.dev"
source: hosted
version: "16.0.0"
firebase_messaging_platform_interface:
dependency: transitive
description:
name: firebase_messaging_platform_interface
sha256: b846a305feb3f74ee3f0aace447f65a4696bc6550bc828ecf5a84a1b77473d16
url: "https://pub.dev"
source: hosted
version: "4.7.0"
firebase_messaging_web:
dependency: transitive
description:
name: firebase_messaging_web
sha256: "28714749880f7242c5fb3b1ee6c66b41f61453f02ae348b43c82957df80b87ae"
url: "https://pub.dev"
source: hosted
version: "4.0.0"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:

@ -26,6 +26,8 @@ dependencies:
emojis: ^0.9.9 emojis: ^0.9.9
file_picker: ^10.3.1 file_picker: ^10.3.1
file_selector: ^1.0.3 file_selector: ^1.0.3
firebase_core: ^4.0.0
firebase_messaging: ^16.0.0
flutter: flutter:
sdk: flutter sdk: flutter
flutter_foreground_task: ^9.1.0 flutter_foreground_task: ^9.1.0

@ -1,12 +1,15 @@
#!/usr/bin/env bash #!/usr/bin/env bash
flutter pub add fcm_shared_isolate flutter pub add firebase_core
flutter pub add firebase_messaging
flutter pub get flutter pub get
if [[ "$OSTYPE" == "darwin"* ]]; then if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' 's,//<GOOGLE_SERVICES>,,g' lib/main.dart
sed -i '' 's,//<GOOGLE_SERVICES>,,g' lib/utils/background_push.dart sed -i '' 's,//<GOOGLE_SERVICES>,,g' lib/utils/background_push.dart
sed -i '' -e 's,^/\*,,' -e 's,\*/$,,' android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt sed -i '' -e 's,^/\*,,' -e 's,\*/$,,' android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt
else else
sed -i 's,//<GOOGLE_SERVICES>,,g' lib/main.dart
sed -i 's,//<GOOGLE_SERVICES>,,g' lib/utils/background_push.dart sed -i 's,//<GOOGLE_SERVICES>,,g' lib/utils/background_push.dart
sed -i -e 's,^/\*,,' -e 's,\*/$,,' android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt sed -i -e 's,^/\*,,' -e 's,\*/$,,' android/app/src/main/kotlin/chat/fluffy/fluffychat/FcmPushService.kt
fi fi

@ -1,5 +1,6 @@
#!/bin/sh -ve #!/bin/sh -ve
flutter pub add fcm_shared_isolate:0.1.0 flutter pub add firebase_core
flutter pub add firebase_messaging
sed -i '' 's,//<GOOGLE_SERVICES>,,g' lib/utils/background_push.dart sed -i '' 's,//<GOOGLE_SERVICES>,,g' lib/utils/background_push.dart
flutter clean flutter clean
flutter pub get flutter pub get

@ -11,6 +11,7 @@
#include <dynamic_color/dynamic_color_plugin_c_api.h> #include <dynamic_color/dynamic_color_plugin_c_api.h>
#include <emoji_picker_flutter/emoji_picker_flutter_plugin_c_api.h> #include <emoji_picker_flutter/emoji_picker_flutter_plugin_c_api.h>
#include <file_selector_windows/file_selector_windows.h> #include <file_selector_windows/file_selector_windows.h>
#include <firebase_core/firebase_core_plugin_c_api.h>
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h> #include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h> #include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
#include <geolocator_windows/geolocator_windows.h> #include <geolocator_windows/geolocator_windows.h>
@ -32,6 +33,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
registry->GetRegistrarForPlugin("EmojiPickerFlutterPluginCApi")); registry->GetRegistrarForPlugin("EmojiPickerFlutterPluginCApi"));
FileSelectorWindowsRegisterWithRegistrar( FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows")); registry->GetRegistrarForPlugin("FileSelectorWindows"));
FirebaseCorePluginCApiRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FirebaseCorePluginCApi"));
FlutterSecureStorageWindowsPluginRegisterWithRegistrar( FlutterSecureStorageWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
FlutterWebRTCPluginRegisterWithRegistrar( FlutterWebRTCPluginRegisterWithRegistrar(

@ -8,6 +8,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
dynamic_color dynamic_color
emoji_picker_flutter emoji_picker_flutter
file_selector_windows file_selector_windows
firebase_core
flutter_secure_storage_windows flutter_secure_storage_windows
flutter_webrtc flutter_webrtc
geolocator_windows geolocator_windows

Loading…
Cancel
Save