Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Don't schedule notifications on Android 7 so the app doesnt crash #784

Conversation

MaikelStuivenberg
Copy link
Contributor

Description

@MaikelStuivenberg MaikelStuivenberg requested a review from a team as a code owner June 6, 2024 13:07
@github-actions github-actions bot added the bug Something isn't working label Jun 6, 2024
@@ -286,6 +288,15 @@ class NotificationService implements INotificationService {
id ??= Random().nextInt(9999 - 1000) + 1000;

await setupFlutterNotifications();

if (Platform.isAndroid) {
final androidInfo = await DeviceInfoPlugin().androidInfo;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it would be good to surround this section with a try/catch in case getting the info fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you recheck? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think in this way we can catch errors while fetching android info and errors while scheduling the notification.

In all error cases i'm not scheduling the notification, just to be sure.. :)

@MaikelStuivenberg MaikelStuivenberg merged commit 8c12670 into develop Jun 7, 2024
1 check passed
@MaikelStuivenberg MaikelStuivenberg deleted the bug/kids-798-givt-app-doesnt-work-anymore-on-android-7 branch June 7, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants