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

Fails to retrieve areNotificationsAllowed value for Android #243

Open
AnastasiiaSob opened this issue Jan 3, 2025 · 4 comments
Open

Fails to retrieve areNotificationsAllowed value for Android #243

AnastasiiaSob opened this issue Jan 3, 2025 · 4 comments

Comments

@AnastasiiaSob
Copy link

Preliminary Info

What Airship dependencies are you using?

airship_flutter: ^9.1.0

What are the versions of any relevant development tools you are using?

Flutter 3.27.1
Dart 3.6.0
firebase_core: ^3.9.0

Report

What unexpected behavior are you seeing?

Starting my app on Android and retrieving the user's choice about whether push notifications are allowed caused the error:

D/App - UALib(16214): PermissionsManager - Checking permission status for display_notifications
D/App - UALib(16214): PermissionsManager - Permission display_notifications request result: granted
E/flutter (16214): [ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: PlatformException(AIRSHIP_ERROR, Unsupported value: 'StandaloneCoroutine{Active}@be1b4c8' of type 'class kotlinx.coroutines.StandaloneCoroutine', Method: push#getNotificationStatus, null)
E/flutter (16214): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:646:7)
E/flutter (16214): #1      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:334:18)
E/flutter (16214): <asynchronous suspension>
E/flutter (16214): #2      AirshipPush.notificationStatus (package:airship_flutter/src/airship_push.dart:49:9)
E/flutter (16214): <asynchronous suspension>

What is the expected behavior?

I can retrieve the user's choice: true if push notifications are allowed, and false if they are not.

What are the steps to reproduce the unexpected behavior?

Configure Airship and then call:

Airship.push.setUserNotificationsEnabled(true);
final status = await Airship.push.notificationStatus;
isPushAllowed = status.areNotificationsAllowed;

Do you have logging for the issue?

See above.

@crow
Copy link
Contributor

crow commented Jan 3, 2025

@AnastasiiaSob At first glance this appears to be a method channel serialization issue on our end. Taking a look. Thanks for reporting.

@crow
Copy link
Contributor

crow commented Jan 5, 2025

@AnastasiiaSob Found the issue and submitted a patch PR. Should get a patch out this week. Thanks again for reporting.

@AnastasiiaSob
Copy link
Author

@crow great, thanks for the quick fix!

@AnastasiiaSob
Copy link
Author

Hi @crow , could you please share any updates on the new patch release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants