Ability to remove tags?

Hi, 

I am very happy to see how this service and its plugin is maturing. Device to device messaging is very powerful so thank you very much for bringing this capability to us. 

I have another question. Would it be possible to offer an API to remove tags? Something to undo the effects of the following API : 

GameThrivePushNotifications.TagPlayerWithTable()

Is this something that you might consider soon? Something like 

GameThrivePushNotifications.UnTagPlayerWithTable()

Additionally can we also have a version that removes all tags associated with a player? Something like 

GameThrivePushNotifications.PlayeRemoveAllTags()

Thank you so very much for considering. 

I’m not sure if it works, but if the API behaves like Lua, then maybe calling 

TagPlayerWithTable({}) (with an empty table, or maybe nil) might remove all tags.

TagPlayer(“myKey”, nil) might remove a tag.

(@George :)) If it doesn’t, maybe that’s one way to implement it?

Great idea! That reduces the number of calls we need to remember!  :slight_smile:

Good question! The (only) way to remove a tag is to set it’s value to be a blank string or nil. ingemar has it right in his second example.

We’ll update our documentation to make this more clear.

Thanks for the update. But what if we don’t know which tag a player has? I would like to be able to reset the tags and start over again. Is this possible somehow? Appreciate your time taken to respond to our queries. 

Happy to help ksan.

The easiest way would be to call  TagPlayerWithTable  with every possible tag that a player may have (even if they don’t necessarily have them) and set all of them to nil. I should clarify my above post as well – TagPlayerWithTable can be used to remove tags, but you have to specify the name of the tag with the value nil for each tag you want to remove.

Alternately, you can get a list of the player’s current tags and values through our API by making a GET request to the following path:

https://gamethrive.com/api/v1/players/{player-id}

Substitute player-id with the person’s gamethrive player-id. To get this value you can use GameThrive.IdsAvailableCallback(IdsAvailable) as documented here: http://docs.coronalabs.com/daily/plugin/GameThrivePushNotifications/IdsAvailableCallback.html

Ok. So there is a way currently for us to query the tags a player might have, take note of these and then issue multiple calls assigning these tags to nil. It will work. 

For future enhancement though, it would be nice if we had an easier way to just remove all tags. Not a critical one though as there is a workaround. Thank you very much. 

Yep. And you just read my mind: We’ll add a method to remove all tags in a future update to the plugin.

Super. I appreciate the very responsive nature of this venture! Wishing you all the very best and success! 

By the way, we added better support for this a couple days ago:

http://docs.coronalabs.com/daily/plugin/GameThrivePushNotifications/index.html

 

GameThrive.GetTags() GameThrive.DeleteTag() GameThrive.DeleteTags()

Great!!! Thanks for your kind follow up.

Edit : I’m still missing GameThrive.DeleteTags(All) though. What can I say? You spoiled me already so I feel I ought to ask! :slight_smile:

Thanks so much!!!

I wonder if you pass an empty table to DeleteTags() would it do what you are after…

That would be great too.

Why not give it a try? I remember a previous post where another one of their api’s worked in this manner.

Hope this helps :slight_smile:

PS: This product looks awesome

Here’s how you can do it:

function gotTagsCallback(tags)    tagNames = {}    for key,value in pairs(tags) do       table.insert(tagNames,key)    end    GameThrive.DeleteTags(tagNames) end GameThrive.GetTags(gotTagsCallback)

Thanks George, that will work great. I really appreciate your support and responsiveness. Gremlin, didn’t mean to sound demanding and I was going to try it anyways. Currently away from dev machine. This message posted on iPad. I fully agree the GameThrive product and people behind it are tremendous. Have a good weekend.

Hah, not at all :slight_smile: I knew you were not trying to sound demanding. I am also away from my dev machine (on iPhone right now), otherwise i would have tried it before posting.

In any-case, we have an answer now :>

Have a great weekend yourself!

I’m not sure if it works, but if the API behaves like Lua, then maybe calling 

TagPlayerWithTable({}) (with an empty table, or maybe nil) might remove all tags.

TagPlayer(“myKey”, nil) might remove a tag.

(@George :)) If it doesn’t, maybe that’s one way to implement it?

Great idea! That reduces the number of calls we need to remember!  :slight_smile:

Good question! The (only) way to remove a tag is to set it’s value to be a blank string or nil. ingemar has it right in his second example.

We’ll update our documentation to make this more clear.