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

[Bug]: 5.0.4 Android SDK await addTagWithKey hangs #799

Closed
1 task done
johanlantz opened this issue Nov 30, 2023 · 4 comments
Closed
1 task done

[Bug]: 5.0.4 Android SDK await addTagWithKey hangs #799

johanlantz opened this issue Nov 30, 2023 · 4 comments

Comments

@johanlantz
Copy link

johanlantz commented Nov 30, 2023

What happened?

Migrating to 5.0.4 I am doing this init:

Future<bool> initOnesignal() async {
    OneSignal.initialize(myAppId);
    OneSignal.login(myExternalId);
    OneSignal.Location.setShared(false);
    OneSignal.User.addTagWithKey('aKey', 'aValue');
    return await OneSignal.Notifications.requestPermission(true);
}

However since most of these functions are async I added await on them but using:
await OneSignal.User.addTagWithKey('aKey', 'aValue');

Causes Android to hang, took me quite some time to understand why the permission prompt did not show. In iOS it is fine.

There is a 202 response in the log for uploading the tag but does not work properly.

Steps to reproduce?

See code above

What did you expect to happen?

The sdk should not hang

OneSignal Android SDK version

5.0.4

Android version

13

Specific Android models

Pixel 7a with Android 14

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jennantilla
Copy link
Contributor

Hello @johanlantz thanks for reaching out! Just to clarify, are you using the Android native SDK and theaddTag method? We do not have an addTagWithKey method. Thanks for the additional information!

@johanlantz
Copy link
Author

This is using the Flutter SDK on an Android phone. I assumed it uses the native Android SDK under the hood but I guess the issue could also be in the plugin.

@nan-li nan-li transferred this issue from OneSignal/OneSignal-Android-SDK Dec 11, 2023
@nan-li
Copy link
Contributor

nan-li commented Dec 11, 2023

Hey @johanlantz,
Yes this await comes from the plugin itself when it calls into the native Android SDK. Thanks for reporting, we will investigate.

@nan-li
Copy link
Contributor

nan-li commented Jan 30, 2024

Hi @johanlantz, thanks again for reporting this issue and your patience.

We have released the fix in Release 5.1.0.

Please update and reach out if you are still seeing issues. Thanks!

@nan-li nan-li closed this as completed Jan 30, 2024
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

3 participants