Skip to content

Commit

Permalink
Update Migration Guide with async getter methods
Browse files Browse the repository at this point in the history
  • Loading branch information
jennantilla committed Feb 14, 2024
1 parent d4f3174 commit 0dd5572
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ The Push Subscription namespace is accessible via `OneSignal.User.pushSubscripti
| `OneSignal.User.pushSubscription.getPushSubscriptionId()` | _**DEPRECATED**<br>use `getIdAsync`._ |
| `OneSignal.User.pushSubscription.getPushSubscriptionToken()` | _**DEPRECATED**<br>use `getTokenAsync`_ |
| `OneSignal.User.pushSubscription.getOptedIn()` | _**DEPRECATED**<br>use `getOptedInAsync`_ |
| `OneSignal.User.pushSubscription.getIdAsync()` | _The readonly push subscription ID._ |
| `OneSignal.User.pushSubscription.getTokenAsync()` | _The readonly push token._ |
| `OneSignal.User.pushSubscription.getOptedInAsync()` | _Gets a boolean value indicating whether the current user is opted in to push notifications. This returns `true` when the app has notifications permission and `optedOut` is called. **_Note:_** Does not take into account the existence of the subscription ID and push token. This boolean may return `true` but push notifications may still not be received by the user._ |
| `await OneSignal.User.pushSubscription.getIdAsync()` | _The readonly push subscription ID._ |
| `await OneSignal.User.pushSubscription.getTokenAsync()` | _The readonly push token._ |
| `await OneSignal.User.pushSubscription.getOptedInAsync()` | _Gets a boolean value indicating whether the current user is opted in to push notifications. This returns `true` when the app has notifications permission and `optedOut` is called. **_Note:_** Does not take into account the existence of the subscription ID and push token. This boolean may return `true` but push notifications may still not be received by the user._ |
| `OneSignal.User.pushSubscription.optIn()` | _Call this method to receive push notifications on the device or to resume receiving of push notifications after calling `optOut`. If needed, this method will prompt the user for push notifications permission._ |
| `OneSignal.User.pushSubscription.optOut()` | _If at any point you want the user to stop receiving push notifications on the current device (regardless of system-level permission status), you can call this method to opt out._ |
| `OneSignal.User.pushSubscription.addEventListener('change', listener: (event) => void)`<br><br>**_See below for usage_** | _Adds the listener to run when the push subscription changes._ |
Expand Down Expand Up @@ -257,7 +257,8 @@ The Notifications namespace is accessible via `OneSignal.Notifications` and prov

| **React Native** | **Description** |
|--------------------------------------- | --------------- |
| `OneSignal.Notifications.hasPermission()` | _Whether this app has push notification permission._ |
| `OneSignal.Notifications.hasPermission()` | _**DEPRECATED**<br>use `getPermissionAsync()`_ |
| `OneSignal.Notifications.getPermissionAsync()` | _Whether this app has push notification permission._ |
| `await OneSignal.Notifications.canRequestPermission()` | _Whether attempting to request notification permission will show a prompt. Returns `true` if the device has not been prompted for push notification permission already._ |
| `await OneSignal.Notifications.permissionNative()` | _(ios only) Returns the enum for the native permission of the device. It will be one of: NotDetermined, Denied, Authorized, Provisional (only available in iOS 12), Ephemeral (only available in iOS 14)_ |
| `OneSignal.Notifications.clearAll();` | _Removes all OneSignal notifications._ |
Expand Down

0 comments on commit 0dd5572

Please sign in to comment.