-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add getters and observer for onesignal ID and external ID #1627
Conversation
bd86288
to
9e32b78
Compare
9364c2a
to
9d6f01b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having trouble running and testing, so these are just comments while I am not able to run the app
android/src/main/java/com/onesignal/rnonesignalandroid/RNOneSignal.java
Outdated
Show resolved
Hide resolved
@nan-li I Successfully reran these test scenarios on Android 14 Emulator and iOS 17.2 Emulator:
|
sendEvent("OneSignal-userStateChanged", | ||
RNUtils.convertHashMapToWritableMap( | ||
RNUtils.convertUserChangedStateToMap(state))); | ||
Log.i("OneSignal", "sending user state change event"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a blocker, avoid using android.util.Log
- since it looks like we are using that a lot already, we can refactor in the future.
The reason is similar to this PR done for ios: OneSignal/OneSignal-iOS-SDK#1219
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for flagging! Refactoring will happen in a future PR.
- add getters for onesignal ID/external ID - add user state observer
93bff1c
to
4997f20
Compare
Description
One Line Summary
Add getters for onesignal ID and external ID, and a user state observer to know when these values are changed.
Details
Motivation
From developer feedback and to support integration partners, we are exposing the onesignal ID and external ID with getters.
We also want to grant developers the ability to add observers that can be called when there is a change in user state.
Testing
Manual testing
Manually tested on:
Tested adding observer for user state and calling new methods to access externalId and onesignalId. Ensured congruency between iOS and Android responses.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is