diff --git a/CHANGELOG.md b/CHANGELOG.md index 307ce68f..7c214313 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.2.10 + +- Fix: Issue with push notifications on Android + ## 0.2.9 - Improved: Make contact avatars clickable diff --git a/lib/app.dart b/lib/app.dart index 8651c543..02be717f 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -133,7 +133,11 @@ class _AppMainWidgetState extends State { Future initAsync() async { Log.info('AppWidgetState: initAsync started'); if (userService.isUserCreated) { - unawaited(FirebaseMessaging.instance.requestPermission()); + try { + unawaited(FirebaseMessaging.instance.requestPermission()); + } catch (e) { + Log.error(e); + } if (_isTwonlyLocked) { // do not change in case twonly was already unlocked at some point _isTwonlyLocked = userService.currentUser.screenLockEnabled; diff --git a/lib/globals.dart b/lib/globals.dart index cd9ccc07..87b0e975 100644 --- a/lib/globals.dart +++ b/lib/globals.dart @@ -9,18 +9,24 @@ class AppEnvironment { static late final String cacheDir; static late final String supportDir; + static bool _isInitialized = false; + // will be loaded in the main_camera_controller.dart static List cameras = []; static Future init() async { + if (_isInitialized) return; cacheDir = (await getApplicationCacheDirectory()).path; supportDir = (await getApplicationSupportDirectory()).path; Log.init(); + _isInitialized = true; } static void initTesting() { + if (_isInitialized) return; cacheDir = '/tmp/twonly_cache'; supportDir = '/tmp/twonly_support'; + _isInitialized = true; } } diff --git a/pubspec.yaml b/pubspec.yaml index 378fba9a..61a7d45b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: "twonly, a privacy-friendly way to connect with friends through sec publish_to: 'none' -version: 0.2.9+118 +version: 0.2.10+119 environment: sdk: ^3.11.0