-
Notifications
You must be signed in to change notification settings - Fork 376
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 public getTags
method
#1609
Conversation
android/src/main/java/com/onesignal/rnonesignalandroid/RNOneSignal.java
Outdated
Show resolved
Hide resolved
The try/catch block is unnecessary since creating a new JSONObject from a Map will not throw a JSONException.
@emawby @nan-li @jennantilla why is getTags asynchronous here? This is not consistent with our other SDKs and with the description "returns local tags" https://documentation.onesignal.com/docs/mobile-sdk-reference#gettags |
@rgomezp The call needs to go over the bridge to call the native function and receive the result. It's not consistent with the native SDKs since they don't need to do this. |
@nan-li I forgot about that limitation. Thanks! |
Description
One Line Summary
Add public
OneSignal.User.getTags()
method to return local tags for the current user.Details
Add
getTags
public method that will return local tags for the current user on both Android and iOS.Motivation
We removed the
getTags
method in v5 of the SDKs to discourage use of OneSignal tags as a data store. We have heard feedback from app developers that they have a need for this method still, so we are adding back an implementation to return the local tags.Scope
Keep note it returns the local tags and not via a server fetch so any tags added mid-session through the REST API will not be reflected.
Testing
Unit testing
None
Manual testing
Successfully call new method getTags on iPhone 15 emulator running iOS 17.0.1 and Pixel 7 running Android 14.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is