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

Provide onesignalId within the user namespace

Open ElwynVdb opened this issue 1 year ago • 1 comments

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 onesignalId is 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.

ElwynVdb avatar Apr 25 '24 06:04 ElwynVdb

@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.

veewee avatar May 03 '24 06:05 veewee