SDKs do not support retrieval of Named User and Tag Groups

The APIs provided by the SDKs don't seem to provide a way to actually retrieve a Named User's tag groups. Am I right or am I missing something? If I am right, will this be added soon. It's not so good that we can set tags into groups and delete them, but not actually fetch them. We're building a Cordova app, so we are invoking the SDKs via your Cordova plugin.

Didn't find what you were looking for?

New post

Comments

8 comments

  • Hi John,

    Welcome to the Urban Airship Community Forums!

    If you need to retrieve a list of Named Users, you can do this using our API (the /api/named_users/ endpoint). You can read additional information regarding our API and how to retrieve a list of Named Users by referring to our Named Users API Documentation.

    This document will provide you with the information that you're looking for.

     

    Best Regards,

    -Joshua

    Urban Airship Technical Support

    0
  • Hi, We're not using the web services. We're using your Cordova plugin, which uses the SDKs. I'd like to know if there are plans to support this from the SDKs.

    0
  • Hi John,

    Named User Tag Groups are designed to be manipulated by the server, so I'm not sure we will add a function for the device to retrieve these.

    However, you can use the link Josh provided and make an API call from the Javascript running in your Cordova App, as  a workaround.

     

    Thank you,
    Sean Conlin
    Urban Airship Technical Support
    Portland, Oregon

    0
  • Hi, Thanks for the reply. I don't understand. I can manipulate tags within a tag group from the SDK. You offer the methods for this in the plugin/SDK. E.g

    UAirship.editNamedUserTagGroups()
            .addTags("loyalty", ["platinum-member", "gold-member"])
            .removeTags("loyalty", ["silver-member", "bronze-member"])

     

    What's the logic in letting me set and delete tags into tag groups from the plugin/SDK, but *not* then letting me retrieve them later so I can actually look at them?

    What don't I get about this?

    0
  • Basically the concept of Named Users and Tag Groups, and the use case they were designed for, is to identify devices by the server rather than the device. Typically this is done to link up data in a CRM to data from the device. The function you mention is present in our SDK as a way to have the tags in the Tag Group change as a result of an action on the device without going through the server. However, these tags are not stored on the device itself the same way that Primary Device Tags are, and so interacting with them is fundamentally different.

    The bottom line is that there is no function in our Javascript API to retrieve the tags from a Named User, but you can work around this by making an API call from the page being displayed in Cordova using Our Named User API.

    Thank you,
    Sean Conlin
    Urban Airship Technical Support
    Portland, Oregon

    0
  • I should add that the best way to manage tags from the device is to use Primary Device tags. The functions for setting and getting Primary Device Tags in our Cordova plugin are simply setTags() and getTags().

    0
  • Yes, we are using setTags(). We were taking your advice to move away from Aliases toward Named Users, and Tag Groups seemed to make sense. Let me give you our use case, and then you can tell me if I am all wet...

    In our app, we want users to be able to subscribe to certain sets of notifications. We call these "subscriptions". Rather than using the default "device" group that we get with setTags(), we thought it made sense to use a tag group -- e.g. "Subscriptions" -- and put the subscription preferences into that group as individual tags. Two reasons to do this: 1) It helps organization these tags, so that they are not mixed with other tags we set from the device that have nothing to do with these subscriptions; and 2) It opens up the possibility to share subscription preferences among multiple devices that a given Named User might be using our app on.

    And the reason we want to be able to retrieve a set of tags from a tag group is so that we can pre-select the user's subscription preferences in the UI, to show them what their preferences are and to let them change them.

    We know we can do this the "old way", with Aliases and legacy tags. It's just not as clean as it could be if we could use Named Users and Tag Groups.

    0
  • John,

    Thanks for sharing your use case, that make perfect sense to me. I would continue to use Named Users and Tag Groups, and use the API call to retrieve the tags, as I believe this is what a native method would be doing anyway.

    I know there are plans to update the Cordova plugin soon, so I will put in an enhancement request to add a UAirship.getNamedUserTagGroups() method for our Javascript API.

    Thank you,
    Sean Conlin
    Urban Airship Technical Support
    Portland, Oregon

    0

Please sign in to leave a comment.