Understanding Tags in urban airship

I have successfully integrated urban airship in my android application. 

I am working with the tags currently,

I am adding one tag while startup and successfully getting the notification for the tag bu using cURL request.

Interestingly if i am providing the "UserID" of the application's user in the tag of cURL request (which is not in tags), I am still getting a notification.

Please guide me through this

Didn't find what you were looking for?

New post

Comments

3 comments

  • Hello,

    This is Sean with Urban Airship Technical Support.

    Can you provide an example curl request where the notification is being delivered to the device unexpectedly?

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

    1
  • Hi Sean,

    Thank you for your quick response,

    Please find the details for the cURL request, 

    While instantiating android application I saved the tag "test" for my urban airship account . If I use the below command the notification is getting called only to the devices who has "test" tag configured.

    curl https://go.urbanairship.com/api/push \
    -X POST \
    -u "<Secrete key>" \
    -H "Accept: application/vnd.urbanairship+json; version=3" \
    -H "Content-Type: application/json" \
    -d '{
    "audience": { "tag": "test"},
    "notification": {
    "alert": "Extras example",
    "android": {
    "extra": {
    "my_Message": "This is simple request"
    }
    }
    },
    "device_types": ["android"]
    }'

    Let us assume that my user ID is XYZ123, and if I set the tag of the userID in cURL request then also the push notification is received on devices although the tag with user id is configured.

    curl https://go.urbanairship.com/api/push \
    -X POST \
    -u "<Secrete key>" \
    -H "Accept: application/vnd.urbanairship+json; version=3" \
    -H "Content-Type: application/json" \
    -d '{
    "audience": { "tag": "XYZ123"},
    "notification": {
    "alert": "Extras example",
    "android": {
    "extra": {
    "my_Message": "This is simple request"
    }
    }
    },
    "device_types": ["android"]
    }'

    Thanks,

    0
  • In this context, can you clarify what you mean by User ID? Are you using Named Users in this app?

    Also which App Key are you making these requests on?

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

    0

Please sign in to leave a comment.