react-onesignal
react-onesignal copied to clipboard
Provide onesignalId within the user namespace
Overview
This pull request provides a getter function for onesignalId in the User namespace
Benefits
- Provides a straightforward method to retrieve the
onesignalId, enhancing code readability and maintainability. - Supports implementations where direct access to
onesignalIdis crucial, such as for personalized push notifications or user tracking. - Eliminates the need for developers to implement custom solutions for accessing the
onesignalId, thereby reducing potential bugs and code redundancy.
@jkasten2 / @rgomezp
To give some context : this is what one currently needs to use in order to get the onesignal ID:
const oneSignalId = (window.OneSignal?.User as any)._currentUser.onesignalId;
Having to grab it from _currentUser doesn't seem like the way to go here.
Would this be something you are interested in merging? Let us know if we can do anything to help you getting this into this repository.