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

[question]: How to clear all data tags in 5.0.0? #1805

Closed
1 task done
Popda opened this issue Aug 14, 2023 · 5 comments
Closed
1 task done

[question]: How to clear all data tags in 5.0.0? #1805

Popda opened this issue Aug 14, 2023 · 5 comments

Comments

@Popda
Copy link

Popda commented Aug 14, 2023

How can we help?

In 5.0.0 version we have functions to remove tags by name but how should they be managed in case if current tags for user are unknown? In 4.x.x version we could check existing tags with getTags() fun to get names of tags and manage them as we like but it was removed in 5.0.0

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jkasten2
Copy link
Member

jkasten2 commented Aug 14, 2023

@Popda With the 5.0.0 SDK you can simply add the tags each time in your app. The SDK is optimized to only send what is out of sync to OneSignal.

Or by "manage them" is it a must to be able to read them? If so can you give an example?

In the title you have "How to clear all data tags in 5.0.0?", could you explain the reason for this? I am guessing you may not need this as you can now call OneSignal.login to switch Users. When you do so tags don't get shared to other Users so you shouldn't have to clear them any more.

@Popda
Copy link
Author

Popda commented Aug 15, 2023

@jkasten2 tags are set or removed for the user based on his interactions with the app so at some point he may loose some tags but our server gives us only list of tags that user should have and without getTags() we dont know what tags we should remove.
If we had a way to clear tags for the user, we could remove them all and set tags sent by our server

@jennantilla
Copy link
Contributor

@Popda thanks for your patience! We do have the method removeTags which would allow you to provide an array of all tag keys you wish to remove from the user. So as long as you track whatever tags you add, you could use this method. Would that work for your purposes?

@Popda
Copy link
Author

Popda commented Aug 30, 2023

@Popda thanks for your patience! We do have the method removeTags which would allow you to provide an array of all tag keys you wish to remove from the user. So as long as you track whatever tags you add, you could use this method. Would that work for your purposes?

Hi, what if I don't track tags added and don't have list of tags to remove?
In our case we don't track tags added, we just get list of tags we should have from our server so in 4.8.6 we were checking present tegs with getTags function and then removing or adding tags to match our list of tags but in 5.0.0 getTags is not available

@jennantilla
Copy link
Contributor

jennantilla commented Sep 27, 2023

Hi @Popda just wanted to circle back on this.

Currently, there is no SDK method in our 5.0.0 major release to retrieve all stored tags. Accessing this data via the SDK is beyond the intention for data tags, which is purely for messaging purposes.

If you wish to access all the existing tags for your users, you could consider using our CSV exporter so that you can begin tracking tag keys. Similarly, you could bulk-edit tags via CSV import if you wish to delete all data tags.

This request is also being tracked here. Your feedback will be passed along to our Product team so that a method similar to getTags may be considered for future development.

Please let us know if you have any additional questions or concerns!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants