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

Why is that OneSignalId is empty sometimes? #1979

Closed
1 task done
ilhomsoliev opened this issue Feb 2, 2024 · 4 comments
Closed
1 task done

Why is that OneSignalId is empty sometimes? #1979

ilhomsoliev opened this issue Feb 2, 2024 · 4 comments

Comments

@ilhomsoliev
Copy link

ilhomsoliev commented Feb 2, 2024

How can we help?

Basically, OneSignalId is empty when I call OneSignal.User.onesignalId. This is what I see in logs from OneSignal:
[DefaultDispatcher-worker-4] OperationRepo.enqueue(operation: {"name":"update-subscription","appId":"****,"onesignalId":"local-****","subscriptionId":"****","type":"PUSH","enabled":true,"address":"****","status":"SUBSCRIBED"}, flush: false)

Is that normal that OneSignalId starts with 'local'?

And also, when I search user with subscriptionId provided it is different user, because I have login in my app, and when user is changed I login user with different externalId but in this case it is changed, but OneSignal.User.onesignalId gives me empty string. And it stays the same.

(externalId is the user who logined in last)

What should I do?

Code of Conduct

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

Hi @ilhomsoliev that is correct--if a onesignal_id starts with local- it is basically no onesignal ID / missing onesignal ID.

There are various reasons why the OneSignal Id could be in this state. Would you be able to send over the full logs form the device so we can pinpoint the issue?

Thanks!

@EinfachHans
Copy link

@jennantilla i also experienced this, and documented it here: OneSignal/OneSignal-Cordova-SDK#973

@jinliu9508
Copy link
Contributor

Hi @ilhomsoliev, in your case, I would recommend using OneSignal.getUser().addObserver to listen for onesignalId when it becomes available. Note that the IDs might not be updated immediately after you log in/out due to network delays. By using the observer, you can retrieve the most recent ID when it becomes available.

@jkasten2
Copy link
Member

Closing due to no response.

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

5 participants