react-native-onesignal icon indicating copy to clipboard operation
react-native-onesignal copied to clipboard

Update Push Subscription/Permission Getters to Async

Open jennantilla opened this issue 2 years ago • 0 comments

Description

One Line Summary

Update Push Subscription/Permission Getters to Async

Details

Motivation

We received reports of listeners not behaving as expected; certain getters were returning null due to the value not being available until returned from the native bridge. Updating getter methods to async will address this issue.

Scope

New async methods were added while also marking old methods as deprecated. Also updated requestPermission and permssionNative to account for changes made to these getters.

Testing

Manual testing

Tested running and building app on Android 14 emulator and iOS 17.2 Emulator, to ensure new methods work as expected.

Affected code checklist

  • [ ] Notifications
    • [ ] Display
    • [ ] Open
    • [ ] Push Processing
    • [ ] Confirm Deliveries
  • [ ] Outcomes
  • [ ] Sessions
  • [ ] In-App Messaging
  • [ ] REST API requests
  • [X] Public API changes

Checklist

Overview

  • [X] I have filled out all REQUIRED sections above
  • [X] PR does one thing
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • [X] Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • [X] I have included test coverage for these changes, or explained why they are not needed
  • [X] All automated tests pass, or I explained why that is not possible
  • [X] I have personally tested this on my device, or explained why that is not possible

Final pass

  • [X] Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • [X] I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

This change is Reviewable

jennantilla avatar Feb 13 '24 19:02 jennantilla