Skip to content
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

[Bug]: Incorrect key / value tag is create when using User.AddTags api #74

Closed
1 task done
dottam opened this issue Oct 18, 2023 · 5 comments
Closed
1 task done
Labels
Bug Something isn't working

Comments

@dottam
Copy link

dottam commented Oct 18, 2023

What happened?

When you pass-in a dictionary of tags via OneSignal.User.AddTags api, the user tags that are created, the value of the tag is the same as the key. I expect that the key/value should match the dictionary

When I try to use OneSignal.User.AddTag api, not all tags are created. I've verified in the subscription's user tags section in the portal that there are tags missing in the list

Tested on iOS, OneSignalSDK.DotNet v5.0.2

Steps to reproduce?

1. create a maui project
dotnet new maui
2. add OneSignalSDK.DotNet v5.0.2 nuget
3. add the following code in App.xaml.cs
OneSignal.Debug.LogLevel = LogLevel.VERBOSE;
OneSignal.Initialize("YOUR_APP_ID");
OneSignal.Notifications.RequestPermissionAsync(true);
var tags = new Dictionary<string, string>()
{
   { "deviceId", "00000000-0000-0000-0000-000000000000" },
   { "accountId", "1234" },
   { "deviceType", "phone" }
};
OneSignal.User.AddTags(tags);

4. build and launch app and observe the logs

What did you expect to happen?

  • when using OneSignal.User.AddTags api, the user tags created should match the dictionary that pass-in as parameters
  • when using OneSignal.User.AddTag api, all tags should be created

Relevant log output

default	12:46:02.242897+1100	Simba.Platform.IOS	VERBOSE: OneSignal.User addTags called with: ["deviceId": "deviceId", "accountId": "accountId", "deviceType": "deviceType"]
default	12:46:02.245126+1100	Simba.Platform.IOS	VERBOSE: OSOperationRepo enqueueDelta: OSDelta OS_UPDATE_PROPERTIES_DELTA with property: tags value: ["deviceId": "deviceId", "accountId": "accountId", "deviceType": "deviceType"]
default	12:46:07.367523+1100	Simba.Platform.IOS	VERBOSE: OSPropertyOperationExecutor processDeltaQueue with queue: [OSDelta OS_UPDATE_PROPERTIES_DELTA with property: tags value: ["deviceId": "deviceId", "accountId": "accountId", "deviceType": "deviceType"]]
default	12:46:07.858860+1100	Simba.Platform.IOS	VERBOSE: network response (OneSignalUser.OSRequestUpdateProperties): {
    httpStatusCode = 202;
    properties =     {
        tags =         {
            deviceId = deviceId;
            accountId = accountId;
            deviceType = deviceType;
        };
    };
}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@shepherd-l
Copy link
Contributor

Thanks for the detailed info, we are looking into this

We have a limit on how many tags each user can have depending on your plan. What plan are you on?
For free users, we have a limit of 2 tags for each user.
Does this match up with what you are seeing?

You can find the limits for Data Tags here under Message Personalization

@dottam
Copy link
Author

dottam commented Oct 20, 2023

we are on Growth, there's no issue on v4.3.3

@shepherd-l
Copy link
Contributor

I found the source of the issue and we are currently working on verifying the fix.

@shepherd-l shepherd-l added the Bug Something isn't working label Nov 2, 2023
@emawby
Copy link
Contributor

emawby commented Jan 17, 2024

The fix for this will be available in the next release of the SDK. Thank you for your patience

@shepherd-l
Copy link
Contributor

This has been fixed in the latest 5.1.0 release. Please open a new issue if you have any questions or are still having issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants