-
Notifications
You must be signed in to change notification settings - Fork 61
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 get tags #671
Add get tags #671
Conversation
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.
Will the iOS implementation of getTags be included in this PR?
I forgot to mention but, in the Unity SDK we manage a CHANGELOG. Could you update it with your change?
I recommend manually testing the getTags method on Android and iOS with the example app
You can also add a getTags button to the example app to make testing easier in the future
Nit: could you also update the Migration Guide to include the new method
Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @jinliu9508)
OneSignalExample/Assets/StreamingAssets/SwiftPlugin.framework.meta
line 0 at r1 (raw file):
What does deleting this file do?
1ce61f8
to
8361d64
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.
Let's revert the changes to OneSignalExampleScene.unity
in this PR, as it doesn't look related.
e991cbe
to
bd2c14b
Compare
I added a testing button "Get Tags" under the button "Remove Tag" in the example scene so tester can see what getTags() returns. This is a generated file so there are code changes that don't look relevant. |
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.
Looks good! I have some minor nits
I tested GetTags on an emulated Pixel 4 with Android 12 and physical iPhone 12 with iOS 15.5 and the correct values were returned
Reviewed 3 of 4 files at r1, 4 of 11 files at r3, 4 of 8 files at r4.
Reviewable status: 11 of 18 files reviewed, 7 unresolved discussions (waiting on @jinliu9508, @jkasten2, and @nan-li)
com.onesignal.unity.android/Runtime/AndroidUserManager.cs
line 57 at r4 (raw file):
AndroidJavaObject obj = _user.Call<AndroidJavaObject>("getTags"); Dictionary<string, string> dictionary = obj.MapToDictionary(); UnityEngine.Debug.Log(dictionary.Count);
I think you forgot to remove a debug log, could you remove it?
Since the "dictionary" variable is only used for the log, you could also remove it or decide to return it instead
OneSignalExample/Assets/OneSignal/CHANGELOG.md
line 19 at r4 (raw file):
## [5.0.5] ### Changed
I think we should also add that we updated the OneSignal Android and iOS SDK to highlight native changes
It should look something like this. You can also see the same comment in the Changelog history
- Updated included Android SDK to [5.0.5](https://github.com/OneSignal/OneSignal-Android-SDK/releases/tag/5.0.5)
- Updated included iOS SDK to [5.0.5](https://github.com/OneSignal/OneSignal-iOS-SDK/releases/tag/5.0.5)
OneSignalExample/Assets/OneSignal/MIGRATION_GUIDE_v3_to_v5.md
line 177 at r4 (raw file):
| `void AddSms(string sms)` | *Add a new SMS subscription to the current user.* | | `void RemoveSms(string sms)` | *Remove an SMS subscription from the current user.* | | `Dictionary<string, string> GetTags()` | *Return a copy of all tags for the current user. Tags are key:value pairs used as building blocks for targeting specific users and/or personalizing messages.* |
I think we should also highlight that get tags returns the local tags on the user
OneSignalExample/Assets/OneSignal/Example/OneSignalExampleBehaviour.cs
line 380 at r4 (raw file):
Dictionary<string, string> dict = OneSignal.User.GetTags(); string dictionaryString = "{"; foreach(KeyValuePair < string, string > keyValues in dict) {
Nit: could you remove the extra spaces next to the "<" and ">" to look like <string, string>
OneSignalExample/Assets/OneSignal/Example/OneSignalExampleScene.unity
line 11343 at r4 (raw file):
m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: Get Tag
Nit but could you change the button to say "Get Tags" to match the GetTags method name
OneSignalExample/Assets/StreamingAssets/SwiftPlugin.framework.meta
line at r1 (raw file):
Previously, shepherd-l (Shepherd) wrote…
What does deleting this file do?
Why was this file deleted? I don't think we need to delete this file
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 have committed a change addressing all of the concerns, please take a look again!
Reviewed 3 of 4 files at r1, 7 of 11 files at r3, 8 of 8 files at r4.
Reviewable status: 11 of 18 files reviewed, 7 unresolved discussions (waiting on @jkasten2, @nan-li, and @shepherd-l)
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.
Reviewable status: 11 of 18 files reviewed, 5 unresolved discussions (waiting on @jkasten2, @nan-li, and @shepherd-l)
com.onesignal.unity.android/Runtime/AndroidUserManager.cs
line 57 at r4 (raw file):
Previously, shepherd-l (Shepherd) wrote…
I think you forgot to remove a debug log, could you remove it?
Since the "dictionary" variable is only used for the log, you could also remove it or decide to return it instead
Done.
OneSignalExample/Assets/OneSignal/CHANGELOG.md
line 22 at r3 (raw file):
Previously, jkasten2 (Josh Kasten) wrote…
This should be under the "Changed" section instead of "Fixed".
Done.
OneSignalExample/Assets/OneSignal/CHANGELOG.md
line 19 at r4 (raw file):
Previously, shepherd-l (Shepherd) wrote…
I think we should also add that we updated the OneSignal Android and iOS SDK to highlight native changes
It should look something like this. You can also see the same comment in the Changelog history
- Updated included Android SDK to [5.0.5](https://github.com/OneSignal/OneSignal-Android-SDK/releases/tag/5.0.5)
- Updated included iOS SDK to [5.0.5](https://github.com/OneSignal/OneSignal-iOS-SDK/releases/tag/5.0.5)
Done.
OneSignalExample/Assets/OneSignal/MIGRATION_GUIDE_v3_to_v5.md
line 177 at r4 (raw file):
Previously, shepherd-l (Shepherd) wrote…
I think we should also highlight that get tags returns the local tags on the user
Done.
OneSignalExample/Assets/StreamingAssets/SwiftPlugin.framework.meta
line at r1 (raw file):
Previously, shepherd-l (Shepherd) wrote…
Why was this file deleted? I don't think we need to delete this file
Done.
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.
Reviewable status: 11 of 18 files reviewed, 1 unresolved discussion (waiting on @jinliu9508, @jkasten2, and @nan-li)
Add public getTags() method that returns tags from the local user
Add public getTags() method that returns tags from the local user
Add public getTags() method that returns tags from the local user
Add public getTags() method that returns tags from the local user
Add public getTags() method that returns tags from the local user
Add public getTags() method that returns tags from the local user
Add public getTags() method that returns tags from the local user
Add public getTags() method that returns tags from the local user
Description
One Line Summary
Add getTags that returns a map of key-value tags
Details
Motivation
Allow user to get access of tags
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is