diff --git a/lib/main.dart b/lib/main.dart index da84c7f4..c3dd3466 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:collection/collection.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:matrix/matrix.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/utils/client_manager.dart'; @@ -21,7 +22,8 @@ void main() async { WidgetsFlutterBinding.ensureInitialized(); Logs().nativeColors = !PlatformInfos.isIOS; - final clients = await ClientManager.getClients(); + final store = await SharedPreferences.getInstance(); + final clients = await ClientManager.getClients(store: store); // If the app starts in detached mode, we assume that it is in // background fetch mode for processing push notifications. This is @@ -32,7 +34,7 @@ void main() async { // starting the Flutter engine but process incoming push notifications. BackgroundPush.clientOnly(clients.first); // To start the flutter engine afterwards we add an custom observer. - WidgetsBinding.instance.addObserver(AppStarter(clients)); + WidgetsBinding.instance.addObserver(AppStarter(clients, store)); Logs().i( '${AppConfig.applicationName} started in background-fetch mode. No GUI will be created unless the app is no longer detached.', ); @@ -43,11 +45,11 @@ void main() async { Logs().i( '${AppConfig.applicationName} started in foreground mode. Rendering GUI...', ); - await startGui(clients); + await startGui(clients, store); } /// Fetch the pincode for the applock and start the flutter engine. -Future startGui(List clients) async { +Future startGui(List clients, SharedPreferences store) async { // Fetch the pin for the applock if existing for mobile applications. String? pin; if (PlatformInfos.isMobile) { @@ -65,16 +67,17 @@ Future startGui(List clients) async { await firstClient?.accountDataLoading; ErrorWidget.builder = (details) => FluffyChatErrorWidget(details); - runApp(FluffyChatApp(clients: clients, pincode: pin)); + runApp(FluffyChatApp(clients: clients, pincode: pin, store: store)); } /// Watches the lifecycle changes to start the application when it /// is no longer detached. class AppStarter with WidgetsBindingObserver { final List clients; + final SharedPreferences store; bool guiStarted = false; - AppStarter(this.clients); + AppStarter(this.clients, this.store); @override void didChangeAppLifecycleState(AppLifecycleState state) { @@ -84,7 +87,7 @@ class AppStarter with WidgetsBindingObserver { Logs().i( '${AppConfig.applicationName} switches from the detached background-fetch mode to ${state.name} mode. Rendering GUI...', ); - startGui(clients); + startGui(clients, store); // We must make sure that the GUI is only started once. guiStarted = true; } diff --git a/lib/pages/chat_list/chat_list.dart b/lib/pages/chat_list/chat_list.dart index 9b202c49..8828081b 100644 --- a/lib/pages/chat_list/chat_list.dart +++ b/lib/pages/chat_list/chat_list.dart @@ -17,7 +17,6 @@ import 'package:fluffychat/config/app_config.dart'; import 'package:fluffychat/config/themes.dart'; import 'package:fluffychat/pages/chat_list/chat_list_view.dart'; import 'package:fluffychat/pages/settings_security/settings_security.dart'; -import 'package:fluffychat/utils/famedlysdk_store.dart'; import 'package:fluffychat/utils/localized_exception_extension.dart'; import 'package:fluffychat/utils/matrix_sdk_extensions/client_stories_extension.dart'; import 'package:fluffychat/utils/matrix_sdk_extensions/matrix_locals.dart'; @@ -189,7 +188,7 @@ class ChatListController extends State ], ); if (newServer == null) return; - Store().setItem(_serverStoreNamespace, newServer.single); + Matrix.of(context).store.setString(_serverStoreNamespace, newServer.single); setState(() { searchServer = newServer.single; }); @@ -382,7 +381,8 @@ class ChatListController extends State CallKeepManager().initialize(); WidgetsBinding.instance.addPostFrameCallback((_) async { if (mounted) { - searchServer = await Store().getItem(_serverStoreNamespace); + searchServer = + Matrix.of(context).store.getString(_serverStoreNamespace); Matrix.of(context).backgroundPush?.setupPush(); } diff --git a/lib/pages/settings_style/settings_style.dart b/lib/pages/settings_style/settings_style.dart index 72783989..67c6d973 100644 --- a/lib/pages/settings_style/settings_style.dart +++ b/lib/pages/settings_style/settings_style.dart @@ -30,13 +30,13 @@ class SettingsStyleController extends State { if (pickedFile == null) return; await Matrix.of(context) .store - .setItem(SettingKeys.wallpaper, pickedFile.path); + .setString(SettingKeys.wallpaper, pickedFile.path!); setState(() {}); } void deleteWallpaperAction() async { Matrix.of(context).wallpaper = null; - await Matrix.of(context).store.deleteItem(SettingKeys.wallpaper); + await Matrix.of(context).store.remove(SettingKeys.wallpaper); setState(() {}); } @@ -76,7 +76,7 @@ class SettingsStyleController extends State { void changeFontSizeFactor(double d) { setState(() => AppConfig.fontSizeFactor = d); - Matrix.of(context).store.setItem( + Matrix.of(context).store.setString( SettingKeys.fontSizeFactor, AppConfig.fontSizeFactor.toString(), ); diff --git a/lib/utils/background_push.dart b/lib/utils/background_push.dart index 8853cf62..8e67ae92 100644 --- a/lib/utils/background_push.dart +++ b/lib/utils/background_push.dart @@ -37,7 +37,6 @@ import 'package:fluffychat/widgets/fluffy_chat_app.dart'; import '../config/app_config.dart'; import '../config/setting_keys.dart'; import '../widgets/matrix.dart'; -import 'famedlysdk_store.dart'; import 'platform_infos.dart'; //import 'package:fcm_shared_isolate/fcm_shared_isolate.dart'; @@ -55,8 +54,7 @@ class BackgroundPush { String? _fcmToken; void Function(String errorMsg, {Uri? link})? onFcmError; L10n? l10n; - Store? _store; - Store get store => _store ??= Store(); + Future loadLocale() async { final context = matrix?.context; // inspired by _lookupL10n in .dart_tool/flutter_gen/gen_l10n/l10n.dart @@ -271,7 +269,7 @@ class BackgroundPush { if (matrix == null) { return; } - if (await store.getItemBool(SettingKeys.showNoGoogle, false) == true) { + if ((matrix?.store.getBool(SettingKeys.showNoGoogle) ?? false) == true) { return; } await loadLocale(); @@ -374,16 +372,17 @@ class BackgroundPush { oldTokens: oldTokens, useDeviceSpecificAppId: true, ); - await store.setItem(SettingKeys.unifiedPushEndpoint, newEndpoint); - await store.setItemBool(SettingKeys.unifiedPushRegistered, true); + await matrix?.store.setString(SettingKeys.unifiedPushEndpoint, newEndpoint); + await matrix?.store.setBool(SettingKeys.unifiedPushRegistered, true); } Future _upUnregistered(String i) async { upAction = true; Logs().i('[Push] Removing UnifiedPush endpoint...'); - final oldEndpoint = await store.getItem(SettingKeys.unifiedPushEndpoint); - await store.setItemBool(SettingKeys.unifiedPushRegistered, false); - await store.deleteItem(SettingKeys.unifiedPushEndpoint); + final oldEndpoint = + matrix?.store.getString(SettingKeys.unifiedPushEndpoint); + await matrix?.store.setBool(SettingKeys.unifiedPushRegistered, false); + await matrix?.store.remove(SettingKeys.unifiedPushEndpoint); if (oldEndpoint?.isNotEmpty ?? false) { // remove the old pusher await setupPusher( @@ -409,12 +408,12 @@ class BackgroundPush { /// Workaround for the problem that local notification IDs must be int but we /// sort by [roomId] which is a String. To make sure that we don't have duplicated - /// IDs we map the [roomId] to a number and store this number. + /// IDs we map the [roomId] to a number and matrix?.store this number. late Map idMap; Future _loadIdMap() async { idMap = Map.from( json.decode( - (await store.getItem(SettingKeys.notificationCurrentIds)) ?? '{}', + (matrix?.store.getString(SettingKeys.notificationCurrentIds)) ?? '{}', ), ); } @@ -488,7 +487,7 @@ class BackgroundPush { } } if (changed) { - await store.setItem( + await matrix?.store.setString( SettingKeys.notificationCurrentIds, json.encode(idMap), ); diff --git a/lib/utils/client_manager.dart b/lib/utils/client_manager.dart index 1ee71d49..01510ef9 100644 --- a/lib/utils/client_manager.dart +++ b/lib/utils/client_manager.dart @@ -1,21 +1,22 @@ -import 'dart:convert'; - import 'package:flutter/foundation.dart'; import 'package:hive_flutter/hive_flutter.dart'; import 'package:matrix/encryption/utils/key_verification.dart'; import 'package:matrix/matrix.dart'; import 'package:path_provider/path_provider.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import 'package:fluffychat/utils/custom_http_client.dart'; import 'package:fluffychat/utils/custom_image_resizer.dart'; import 'package:fluffychat/utils/matrix_sdk_extensions/flutter_hive_collections_database.dart'; import 'package:fluffychat/utils/platform_infos.dart'; -import 'famedlysdk_store.dart'; abstract class ClientManager { static const String clientNamespace = 'im.fluffychat.store.clients'; - static Future> getClients({bool initialize = true}) async { + static Future> getClients({ + bool initialize = true, + required SharedPreferences store, + }) async { if (PlatformInfos.isLinux) { Hive.init((await getApplicationSupportDirectory()).path); } else { @@ -23,19 +24,15 @@ abstract class ClientManager { } final clientNames = {}; try { - final rawClientNames = await Store().getItem(clientNamespace); - if (rawClientNames != null) { - final clientNamesList = - (jsonDecode(rawClientNames) as List).cast(); - clientNames.addAll(clientNamesList); - } + final clientNamesList = store.getStringList(clientNamespace) ?? []; + clientNames.addAll(clientNamesList); } catch (e, s) { Logs().w('Client names in store are corrupted', e, s); - await Store().deleteItem(clientNamespace); + await store.remove(clientNamespace); } if (clientNames.isEmpty) { clientNames.add(PlatformInfos.clientName); - await Store().setItem(clientNamespace, jsonEncode(clientNames.toList())); + await store.setStringList(clientNamespace, clientNames.toList()); } final clients = clientNames.map(createClient).toList(); if (initialize) { @@ -61,31 +58,27 @@ abstract class ClientManager { clientNames.remove(client.clientName); clients.remove(client); } - await Store().setItem(clientNamespace, jsonEncode(clientNames.toList())); + await store.setStringList(clientNamespace, clientNames.toList()); } return clients; } - static Future addClientNameToStore(String clientName) async { - final clientNamesList = []; - final rawClientNames = await Store().getItem(clientNamespace); - if (rawClientNames != null) { - final stored = (jsonDecode(rawClientNames) as List).cast(); - clientNamesList.addAll(stored); - } + static Future addClientNameToStore( + String clientName, + SharedPreferences store, + ) async { + final clientNamesList = store.getStringList(clientNamespace) ?? []; clientNamesList.add(clientName); - await Store().setItem(clientNamespace, jsonEncode(clientNamesList)); + await store.setStringList(clientNamespace, clientNamesList); } - static Future removeClientNameFromStore(String clientName) async { - final clientNamesList = []; - final rawClientNames = await Store().getItem(clientNamespace); - if (rawClientNames != null) { - final stored = (jsonDecode(rawClientNames) as List).cast(); - clientNamesList.addAll(stored); - } + static Future removeClientNameFromStore( + String clientName, + SharedPreferences store, + ) async { + final clientNamesList = store.getStringList(clientNamespace) ?? []; clientNamesList.remove(clientName); - await Store().setItem(clientNamespace, jsonEncode(clientNamesList)); + await store.setStringList(clientNamespace, clientNamesList); } static NativeImplementations get nativeImplementations => kIsWeb diff --git a/lib/utils/famedlysdk_store.dart b/lib/utils/famedlysdk_store.dart deleted file mode 100644 index 2f16b596..00000000 --- a/lib/utils/famedlysdk_store.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'dart:core'; - -import 'package:shared_preferences/shared_preferences.dart'; - -class Store { - SharedPreferences? _prefs; - - Future _setupLocalStorage() async { - _prefs ??= await SharedPreferences.getInstance(); - } - - Future getItem(String key) async { - await _setupLocalStorage(); - return _prefs!.getString(key); - } - - Future getItemBool(String key, [bool? defaultValue]) async { - await _setupLocalStorage(); - return _prefs!.getBool(key) ?? defaultValue ?? true; - } - - Future setItem(String key, String? value) async { - await _setupLocalStorage(); - if (value == null) { - await _prefs!.remove(key); - return; - } - await _prefs!.setString(key, value); - return; - } - - Future setItemBool(String key, bool value) async { - await _setupLocalStorage(); - await _prefs!.setBool(key, value); - return; - } - - Future deleteItem(String key) async { - await _setupLocalStorage(); - await _prefs!.remove(key); - return; - } -} diff --git a/lib/utils/push_helper.dart b/lib/utils/push_helper.dart index b5111c4c..12b34871 100644 --- a/lib/utils/push_helper.dart +++ b/lib/utils/push_helper.dart @@ -98,7 +98,11 @@ Future _tryPushHelper( //onDidReceiveBackgroundNotificationResponse: onSelectNotification, ); - client ??= (await ClientManager.getClients(initialize: false)).first; + client ??= (await ClientManager.getClients( + initialize: false, + store: await SharedPreferences.getInstance(), + )) + .first; final event = await client.getEventByPushNotification( notification, storeInDatabase: isBackgroundMessage, diff --git a/lib/utils/voip_plugin.dart b/lib/utils/voip_plugin.dart index 3cc9d516..4626c1c4 100644 --- a/lib/utils/voip_plugin.dart +++ b/lib/utils/voip_plugin.dart @@ -11,7 +11,6 @@ import 'package:webrtc_interface/webrtc_interface.dart' hide Navigator; import 'package:fluffychat/pages/chat_list/chat_list.dart'; import 'package:fluffychat/pages/dialer/dialer.dart'; import 'package:fluffychat/utils/platform_infos.dart'; -import '../../utils/famedlysdk_store.dart'; import '../../utils/voip/callkeep_manager.dart'; import '../../utils/voip/user_media_manager.dart'; import '../widgets/matrix.dart'; @@ -133,7 +132,8 @@ class VoipPlugin with WidgetsBindingObserver implements WebRTCDelegate { } else { try { final wasForeground = await FlutterForegroundTask.isAppOnForeground; - await Store().setItem( + + await matrix.store.setString( 'wasForeground', wasForeground == true ? 'true' : 'false', ); @@ -172,7 +172,7 @@ class VoipPlugin with WidgetsBindingObserver implements WebRTCDelegate { if (PlatformInfos.isAndroid) { FlutterForegroundTask.setOnLockScreenVisibility(false); FlutterForegroundTask.stopService(); - final wasForeground = await Store().getItem('wasForeground'); + final wasForeground = matrix.store.getString('wasForeground'); wasForeground == 'false' ? FlutterForegroundTask.minimizeApp() : null; } } diff --git a/lib/widgets/fluffy_chat_app.dart b/lib/widgets/fluffy_chat_app.dart index 708f814f..d9d2f042 100644 --- a/lib/widgets/fluffy_chat_app.dart +++ b/lib/widgets/fluffy_chat_app.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; import 'package:go_router/go_router.dart'; import 'package:matrix/matrix.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import 'package:fluffychat/config/routes.dart'; import 'package:fluffychat/config/themes.dart'; @@ -16,11 +17,13 @@ class FluffyChatApp extends StatelessWidget { final Widget? testWidget; final List clients; final String? pincode; + final SharedPreferences store; const FluffyChatApp({ super.key, this.testWidget, required this.clients, + required this.store, this.pincode, }); @@ -55,6 +58,7 @@ class FluffyChatApp extends StatelessWidget { onGenerateRoute: (_) => MaterialPageRoute( builder: (_) => Matrix( clients: clients, + store: store, child: testWidget ?? child, ), ), diff --git a/lib/widgets/matrix.dart b/lib/widgets/matrix.dart index 26ad915e..026ce4d6 100644 --- a/lib/widgets/matrix.dart +++ b/lib/widgets/matrix.dart @@ -15,6 +15,7 @@ import 'package:image_picker/image_picker.dart'; import 'package:matrix/encryption.dart'; import 'package:matrix/matrix.dart'; import 'package:provider/provider.dart'; +import 'package:shared_preferences/shared_preferences.dart'; import 'package:universal_html/html.dart' as html; import 'package:url_launcher/url_launcher_string.dart'; @@ -29,7 +30,6 @@ import '../config/setting_keys.dart'; import '../pages/key_verification/key_verification_dialog.dart'; import '../utils/account_bundles.dart'; import '../utils/background_push.dart'; -import '../utils/famedlysdk_store.dart'; import 'local_notifications_extension.dart'; // import 'package:flutter_secure_storage/flutter_secure_storage.dart'; @@ -41,9 +41,12 @@ class Matrix extends StatefulWidget { final Map? queryParameters; + final SharedPreferences store; + const Matrix({ this.child, required this.clients, + required this.store, this.queryParameters, super.key, }); @@ -59,7 +62,7 @@ class Matrix extends StatefulWidget { class MatrixState extends State with WidgetsBindingObserver { int _activeClient = -1; String? activeBundle; - Store store = Store(); + SharedPreferences get store => widget.store; HomeserverSummary? loginHomeserverSummary; XFile? loginAvatar; @@ -158,7 +161,10 @@ class MatrixState extends State with WidgetsBindingObserver { if (!widget.clients.contains(_loginClientCandidate)) { widget.clients.add(_loginClientCandidate!); } - ClientManager.addClientNameToStore(_loginClientCandidate!.clientName); + ClientManager.addClientNameToStore( + _loginClientCandidate!.clientName, + store, + ); _registerSubs(_loginClientCandidate!.clientName); _loginClientCandidate = null; FluffyChatApp.router.go('/rooms'); @@ -187,7 +193,7 @@ class MatrixState extends State with WidgetsBindingObserver { try { if (client.isLogged()) { // TODO: Figure out how this works in multi account - final statusMsg = await store.getItem(SettingKeys.ownStatusMessage); + final statusMsg = store.getString(SettingKeys.ownStatusMessage); if (statusMsg?.isNotEmpty ?? false) { Logs().v('Send cached status message: "$statusMsg"'); await client.setPresence( @@ -314,7 +320,7 @@ class MatrixState extends State with WidgetsBindingObserver { if (loggedInWithMultipleClients && state != LoginState.loggedIn) { _cancelSubs(c.clientName); widget.clients.remove(c); - ClientManager.removeClientNameFromStore(c.clientName); + ClientManager.removeClientNameFromStore(c.clientName, store); ScaffoldMessenger.of(context).showSnackBar( SnackBar( content: Text(L10n.of(context)!.oneClientLoggedOut), @@ -391,7 +397,7 @@ class MatrixState extends State with WidgetsBindingObserver { ); } if (result == OkCancelResult.cancel) { - await store.setItemBool(SettingKeys.showNoGoogle, true); + await store.setBool(SettingKeys.showNoGoogle, true); } }, ); @@ -401,7 +407,7 @@ class MatrixState extends State with WidgetsBindingObserver { } void createVoipPlugin() async { - if (await store.getItemBool(SettingKeys.experimentalVoip) == false) { + if (store.getBool(SettingKeys.experimentalVoip) == false) { voipPlugin = null; return; } @@ -419,47 +425,40 @@ class MatrixState extends State with WidgetsBindingObserver { } void initSettings() { - store.getItem(SettingKeys.wallpaper).then((final path) async { - if (path == null) return; - final file = File(path); - if (await file.exists()) { - wallpaper = file; - } - }); - store.getItem(SettingKeys.fontSizeFactor).then( - (value) => AppConfig.fontSizeFactor = - double.tryParse(value ?? '') ?? AppConfig.fontSizeFactor, - ); - store - .getItemBool(SettingKeys.renderHtml, AppConfig.renderHtml) - .then((value) => AppConfig.renderHtml = value); - store - .getItemBool( - SettingKeys.hideRedactedEvents, - AppConfig.hideRedactedEvents, - ) - .then((value) => AppConfig.hideRedactedEvents = value); - store - .getItemBool(SettingKeys.hideUnknownEvents, AppConfig.hideUnknownEvents) - .then((value) => AppConfig.hideUnknownEvents = value); - store - .getItemBool(SettingKeys.separateChatTypes, AppConfig.separateChatTypes) - .then((value) => AppConfig.separateChatTypes = value); - store - .getItemBool(SettingKeys.autoplayImages, AppConfig.autoplayImages) - .then((value) => AppConfig.autoplayImages = value); - store - .getItemBool( - SettingKeys.sendTypingNotifications, - AppConfig.sendTypingNotifications, - ) - .then((value) => AppConfig.sendTypingNotifications = value); - store - .getItemBool(SettingKeys.sendOnEnter, AppConfig.sendOnEnter) - .then((value) => AppConfig.sendOnEnter = value); - store - .getItemBool(SettingKeys.experimentalVoip, AppConfig.experimentalVoip) - .then((value) => AppConfig.experimentalVoip = value); + final path = store.getString(SettingKeys.wallpaper); + if (path != null) wallpaper = File(path); + + AppConfig.fontSizeFactor = + double.tryParse(store.getString(SettingKeys.fontSizeFactor) ?? '') ?? + AppConfig.fontSizeFactor; + + AppConfig.renderHtml = + store.getBool(SettingKeys.renderHtml) ?? AppConfig.renderHtml; + + AppConfig.hideRedactedEvents = + store.getBool(SettingKeys.hideRedactedEvents) ?? + AppConfig.hideRedactedEvents; + + AppConfig.hideUnknownEvents = + store.getBool(SettingKeys.hideUnknownEvents) ?? + AppConfig.hideUnknownEvents; + + AppConfig.separateChatTypes = + store.getBool(SettingKeys.separateChatTypes) ?? + AppConfig.separateChatTypes; + + AppConfig.autoplayImages = + store.getBool(SettingKeys.autoplayImages) ?? AppConfig.autoplayImages; + + AppConfig.sendTypingNotifications = + store.getBool(SettingKeys.sendTypingNotifications) ?? + AppConfig.sendTypingNotifications; + + AppConfig.sendOnEnter = + store.getBool(SettingKeys.sendOnEnter) ?? AppConfig.sendOnEnter; + + AppConfig.experimentalVoip = store.getBool(SettingKeys.experimentalVoip) ?? + AppConfig.experimentalVoip; } @override diff --git a/lib/widgets/settings_switch_list_tile.dart b/lib/widgets/settings_switch_list_tile.dart index 268e5f18..8f4285a4 100644 --- a/lib/widgets/settings_switch_list_tile.dart +++ b/lib/widgets/settings_switch_list_tile.dart @@ -23,19 +23,15 @@ class SettingsSwitchListTile extends StatefulWidget { class SettingsSwitchListTileState extends State { @override Widget build(BuildContext context) { - return FutureBuilder( - future: Matrix.of(context) - .store - .getItemBool(widget.storeKey, widget.defaultValue), - builder: (context, snapshot) => SwitchListTile.adaptive( - value: snapshot.data ?? widget.defaultValue, - title: Text(widget.title), - onChanged: (bool newValue) async { - widget.onChanged?.call(newValue); - await Matrix.of(context).store.setItemBool(widget.storeKey, newValue); - setState(() {}); - }, - ), + return SwitchListTile.adaptive( + value: Matrix.of(context).store.getBool(widget.storeKey) ?? + widget.defaultValue, + title: Text(widget.title), + onChanged: (bool newValue) async { + widget.onChanged?.call(newValue); + await Matrix.of(context).store.setBool(widget.storeKey, newValue); + setState(() {}); + }, ); } } diff --git a/scripts/enable-android-google-services.patch b/scripts/enable-android-google-services.patch index 2abc2aca..10800f41 100644 --- a/scripts/enable-android-google-services.patch +++ b/scripts/enable-android-google-services.patch @@ -123,11 +123,11 @@ index 85aa8647..3b7e09e7 100644 } diff --git a/lib/utils/background_push.dart b/lib/utils/background_push.dart -index cd79b0ab..c2db0f1e 100644 +index 8e67ae92..da4da5c3 100644 --- a/lib/utils/background_push.dart +++ b/lib/utils/background_push.dart @@ -39,7 +39,7 @@ import '../config/setting_keys.dart'; - import 'famedlysdk_store.dart'; + import '../widgets/matrix.dart'; import 'platform_infos.dart'; -//import 'package:fcm_shared_isolate/fcm_shared_isolate.dart'; @@ -135,7 +135,7 @@ index cd79b0ab..c2db0f1e 100644 class NoTokenException implements Exception { String get cause => 'Cannot get firebase token'; -@@ -65,7 +65,7 @@ class BackgroundPush { +@@ -64,7 +64,7 @@ class BackgroundPush { final pendingTests = >{};