On iOS, and in production, I can't attribute a namedUser to the device anymore


In development, all was fine... 
But UAirship.push().namedUser.identifier = "xxx" doesn't work anymore... 
I successfully register the device, because broadcasts work either in production and in development... 
But if I want to target a specific named user, it doesn't work anymore....

This was a quite useful functionality and was one of the reasons I moved from SNS, plus the auto increment badge...

But also, the badge isn't reseted correctly... 
And to commit any change, I do UAirship.push().updateRegistration() .

Please help, as the app is in private beta but is going soon to move in production with thousands of users ....

Have a good one :)

Didn't find what you were looking for?

New post



  • Hi Hadrien!


    Have you made sure that you have "Allow Named Users to be set from devices" turned on in your Urban Airship dashboard for your Production app?

    If not, you can follow the Settings guide to turn that on.

    Once you've done that, you should see Named Users being set properly.

    For resetting your badge count, ensure that you have the UAirship.push().resetBadge() call in the following methods:

    1. didFinishLaunchingWithOptions
    2. applicationDidBecomeActive
    3. didReceiveRemoteNotification


    Comment actions Permalink
  • Hello Michael ! 

    Thank you for your fast and efficient answer,


    I effectively had forgotten to allow named user settings from devices ! 

    So pushes are working back !

    But badges are still not reseted correctly, and I reset it in all the methods you wrote and enabled 

            UAirship.push()?.autobadgeEnabled = true


    What can I do ? 


    Thanks, take care :)

    Comment actions Permalink
  • Hadrien,

    No problem!


    With regards to your badging, which method are you setting autobadge in?

    Also, what is the value of your badge currently? Does it line up to the amount of messages you've sent to your device, or is it referencing another number?

    Comment actions Permalink
  • I set it in applicationDidFinishLaunchingWithOptions, here are exactly the lines concerning AirshipKit: 



            UAirship.push()?.autobadgeEnabled = true

            UAirship.push()?.userPushNotificationsEnabled = true



    Yes the badge lines up to the amount of messages sent to the device

    Comment actions Permalink
  • Hmm...that seems odd that the badge is not being reset.

    Is it possible to add some logging in your app to see what the app is doing when you tap on a notification? The resetBadge method should get called, and you could set a breakpoint on it to see if it actually is being called. Once you have those logs, you could attach it here(remove your app keys/secrets/device IDs before attaching it)

    Comment actions Permalink

Please sign in to leave a comment.