Android: Changing namedUser id stops push notifications from being received

Hi guys,

I have an issue on an Android client app. After I call takeOff and configure nameUserId and userNotificationsEnabled, everything is ok, the push notifications work. Later on I need to configure another user id (logout for example and login immediately with another user but in the same app session, without restarting it) and push notifs stop working. What I do to disassociate the old user is to set userId to null, and then to the new value. And this way the push notifs stop working. Is there something that I am missing?

Thanks!

Didn't find what you were looking for?

New post

Comments

2 comments

  • Hello,

    This is Sean with Urban Airship Technical Support.

    You do not need to set Named User to null before associating with another Named User, as our system will implicitly disassociate the previous Named User from the device. This extra call could be causing the issue if there is no delay between the null Named User association and the new Named User association.

    Additionally, you may want to wait a couple of minutes before associating with the new Named User before sending the notification in order to account for the occasional delay in registration.

    Please let me know if you have any other questions or concerns.

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

    0
  • Hi Sean,

    Thanks for you answer. We have to set the Named User to null on logout because we can not know if the user will login with another one or not. In case it doesn't, we have to set it to null so that we are sure the app won't get pushes after the user logs out.

    Is there any other way we can make sure the the app won't receive pushes after the user logs out, besides setting the user id to null?

    Meanwhile I will check if adding a delay of couple of minutes will make things work.

    Thank you!

    0

Please sign in to leave a comment.