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]: Empty subscription id #1608

Closed
3 tasks done
nachos5 opened this issue Dec 1, 2023 · 2 comments
Closed
3 tasks done

[Bug]: Empty subscription id #1608

nachos5 opened this issue Dec 1, 2023 · 2 comments

Comments

@nachos5
Copy link

nachos5 commented Dec 1, 2023

What happened?

For a decent chunk of our users (about 4%), a push notification subscription is not being created.

The response from OneSignal.initialize is the following for these users:

{
  "notificationPermission": true,
  "pushSubscriptionState": {
    "id": "",
    "optedIn": true,
    "token": "ftjo7cue........."
  },
  "result": "success"
}

As you can see, the subscription id is empty.

Steps to reproduce?

I can't reproduce this myself, but from Sentry I can see that this is the response for these users.

What did you expect to happen?

I expect the SDK to create a valid subscription.

React Native OneSignal SDK version

5.0.3

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

No response

Code of Conduct

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

Then it's probably an issue on your side,

Are you really sure 100% that you set your id properly and that there is no risk that you login an empty id to one signal ?

@nan-li
Copy link
Contributor

nan-li commented Dec 5, 2023

Hi @nachos5, there is no response from OneSignal.initialize("appId"). What is your code that is returning this?

{
  "notificationPermission": true,
  "pushSubscriptionState": {
    "id": "",
    "optedIn": true,
    "token": "ftjo7cue........."
  },
  "result": "success"
}

Additionally, it may take varying length of time to receive the subscription_id if you are getting it too soon after calling OneSignal.initialize().

@nachos5 nachos5 closed this as completed Dec 8, 2023
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