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]: OneSignal: This method has been deprecated. Use getIdAsync instead for getting push subscription id. #1663

Closed
3 tasks done
Romick2005 opened this issue Mar 13, 2024 · 5 comments

Comments

@Romick2005
Copy link

Romick2005 commented Mar 13, 2024

What happened?

Would be good to know the method name that is deprecated and is in use.

Steps to reproduce?

Previous version 5.0.6 works fine.

What did you expect to happen?

image

React Native OneSignal SDK version

Release 5.0.10

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

OneSignal: This method has been deprecated. Use getIdAsync instead for getting push subscription id.

Code of Conduct

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

nan-li commented Mar 13, 2024

Hi @Romick2005 good call, we will update the log to include the method name.

In Release 5.1.0, the SDK added the method await OneSignal.User.pushSubscription.getIdAsync() as a more accurate getter for the push subscription ID.

The previous getter was OneSignal.User.pushSubscription.getPushSubscriptionId(), which is still fully supported and behaves same as before.

The new async getter will return more accurate data during early app startup, compare to getPushSubscriptionId() which may return undefined.

@hexllhexll
Copy link

The same problem

@Romick2005
Copy link
Author

Romick2005 commented Mar 14, 2024

Replacements:
getPushSubscriptionId -> getIdAsync
getPushSubscriptionToken -> getTokenAsync
getOptedIn -> getOptedInAsync
hasPermission -> getPermissionAsync

@hexllhexll
Copy link

Thank you, problem has been resolved

@jennantilla
Copy link
Contributor

Thank you flagging! The warnings have been updated and will be included in our next React Native 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

4 participants