-
Notifications
You must be signed in to change notification settings - Fork 5
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
[User Model] Add GetTags #84
Conversation
@@ -35,6 +35,7 @@ public void Initialize() | |||
public void AddTags(IDictionary<string, string> tags) => OneSignalNative.User.AddTags(tags); | |||
public void RemoveTag(string key) => OneSignalNative.User.RemoveTag(key); | |||
public void RemoveTags(params string[] keys) => OneSignalNative.User.RemoveTags(keys); | |||
public IDictionary<string, string> GetTags() => OneSignalNative.User.GetTags(); |
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.
error CS1061: 'IUserManager' does not contain a definition for 'GetTags' and no accessible extension method 'GetTags' accepting a first argument of type 'IUserManager' could be found (are you missing a using directive or an assembly reference?) [/Users/elliotmawby/Documents/GitHub/OneSignal-DotNet-SDK/OneSignalSDK.DotNet.Android/OneSignalSDK.DotNet.Android.csproj::TargetFramework=net7.0-android]
b357ff3
to
8e89819
Compare
674badb
to
de8eb8c
Compare
This crashes with a target invocation exception
8e89819
to
db58658
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.
LGTM
getTags correctly reflected the user's tags when I added and removed tags in the example app.
Tested on
Android Emulator: Pixel 4 API 31
iOS Simulator: iPhone 15 iOS 17
However addTags sends the incorrect value on iOS (mentioned here: #78)
Description
One Line Summary
Add GetTags to the User Model SDK
Details
I recommend reviewing by commit since the iOS binary bump includes a lot of file changes
Motivation
Add ability to get the current users tags. Tags are refreshed whenever fetchUser is called (start of session or user change) and are otherwise up to date as tags are changed locally.
Scope
Android and iOS. New method on User namespace
Testing
Unit testing
N/A
Manual testing
Tested on iOS and Android using sample app built in vscode with maui extension
Affected code checklist
Checklist
Overview
Testing
Final pass