Skip to content

Commit

Permalink
do not await notif service registering
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmohsin7 committed Oct 1, 2024
1 parent d0e7ba5 commit fbaf41d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/lib/pages/home/page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class _HomePageWrapperState extends State<HomePageWrapper> {
AnalyticsManager().setUserAttribute('Notifications Enabled', SharedPreferencesUtil().notificationsEnabled);
}
if (SharedPreferencesUtil().notificationsEnabled) {
await NotificationService.instance.register();
NotificationService.instance.register();
}
if (SharedPreferencesUtil().locationEnabled != await Permission.location.isGranted) {
SharedPreferencesUtil().locationEnabled = await Permission.location.isGranted;
Expand Down
2 changes: 2 additions & 0 deletions app/lib/services/notifications.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class NotificationService {
return isAllowed;
}

// Whereever this method is awaited, it will cause the app to not move forwared in execution due to it being a method call.
// This was also the culprit when we had the app freeze on splash screen.
Future<void> register() async {
try {
await platform.invokeMethod(
Expand Down

0 comments on commit fbaf41d

Please sign in to comment.