I'm using Airship to set a user_tier attribute on a contact. I first set a named user id on the contact and then set the attribute as follows:
UAirship.shared().contact.identify(namedUser)
UAirship.shared().contact.editAttributes().setAttribute("user_tier", userTier).apply()
The above code runs each time the user logs into or out of an account within my app. The named user changes as well. There is one named user value for the logged in state and another named user value for the logged out state.
I've been running a test where I log into and out of an account multiple times, and each time I will look at the Airship console to verify that the user_tier attribute has been set to the correct value. I'm using the contact lookup feature of Airship to verify this. I've been looking up the contact by channel id, but looking up by named user works as well.
There appears to be an intermittent issue where the user_tier attribute isn't being set. Meaning it doesn't show up in the attributes list in the contact lookup. I've verified through logging and through network traffic inspection that the call to set the user_tier attribute is indeed being made, and it even returns a 200 OK response. And yet I don't see it show up in the attributes list in the contact lookup.
Does anybody know what might be causing this? Is it possible that there's some kind of race condition that occurs as a result of calling identify and setAttribute back to back like I'm doing above?
Comments
1 comment