OneSignal / react-native-onesignal

React Native Library for OneSignal Push Notifications Service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Romick2005 opened this issue · comments

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
commented

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.

The same problem

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

Thank you, problem has been resolved

Thank you flagging! The warnings have been updated and will be included in our next React Native release.