Community

Community Forums

Where our customers, developers, and more can come together to help each other with both general and technical questions about our products and services.

Can't update "Last registration" date on user's device

fjgutierrez
Hi! I'm working with urban airship (v9.3.1) in an Android project and I've checked that the field "Last registration" is not updating its value even if I force the app to do it using updateRegistration() method. I've also checked your official documentation and you recommend to use that command, so; I don't know why is not working as you said. For the project I'm working on, it's really important to know when was the last time the user registered a device.

Please sign in to leave a comment.

0
Avatar

Hi there,

May I ask where you are calling updateRegistration() in your Android project? Are you willing to share that bit of code as well as the name of the file where you have applied it so I can take a look?

Kind regards,

Chilun Liu

Senior Technical Support Engineer Airship

The Embassy Tea House,

195-205 Union Street, London, SE1 0LN Portland | San Francisco | London | Paris | New York | New Delhi

chilun liu 0 votes
Comment actions Permalink
0
Avatar
Hi Chilun Liu,
 
I'm calling to the method updateRegistration() after adding a few tags with information about the registered device; just after the user has made log in successfully. Previously to that, I did the takeOff and all the urban configuration's things.
 
The code I'm using is what follows:
String deviceTagName = String.format("%s%s", Constants.TAG_URBAN_DEVICE, Utils.getDeviceName().toUpperCase());
        
        Set<String> tags = UAirship.shared().getPushManager().getTags();
        tags.add(deviceTagName);
        tags.add(Utils.isTablet() ? Constants.TAG_URBAN_DEVICE_TYPE_TABLET : Constants.TAG_URBAN_DEVICE_TYPE_SMARTPHONE);
        UAirship.shared().getPushManager().setTags(tags);
        UAirship.shared().getPushManager().updateRegistration();
fjgutierrez 0 votes
Comment actions Permalink
0
Avatar

Hi again,

When using .setTags, are you expecting the tags to be appended to that device when eventually calling updateRegistraton?

Kind regards,

Chilun Liu 

Senior Technical Support Engineer Airship 

The Embassy Tea House,

195-205 Union Street, London, SE1 0LN Portland | San Francisco | London | Paris | New York | New Delhi

chilun liu 0 votes
Comment actions Permalink
0
Avatar
Hi again Chilun Liu,
 
no, I'm not waiting. Are you suggestion that the setTags() methods is asynchronous?
I thought the problem was that the line 
UAirship.shared().getPushManager().updateRegistration();
wasn't working properly.
fjgutierrez 0 votes
Comment actions Permalink
0
Avatar

Hi again,

I've taken another look at your updateRegistration call:

UAirship.shared().getPushManager().updateRegistration();

I've only known the call to exist like this (https://docs.airship.com/platform/ios/segmentation/):

UAirship.push().updateRegistration()

Can you use the one I've mentioned above and then see if that gets called?

Kind regards,

Chilun Liu 

Senior Technical Support Engineer Airship 

The Embassy Tea House,

195-205 Union Street, London, SE1 0LN Portland | San Francisco | London | Paris | New York | New Delhi

chilun liu 0 votes
Comment actions Permalink
0
Avatar
Hi Chilun Liu,
 
I've tried the solution that you gave me in your last post, but the problem is that your solution is for iOS platforms. I've read the segmentation's documentation for android (https://docs.airship.com/platform/android/segmentation/ ) and always have to use UAirship.shared().getPushManager().[the method you want to use].
Do you have any other idea to try?
Thank you
fjgutierrez 0 votes
Comment actions Permalink
0
Avatar

Hi again,

I have spoken about this at length internally and it seems that calling "updateRegistration" immediately after you make the tag change - that doesn't actually occur straight away (I'm still confirming with several departments as to how long you will have to wait, so bear with me whilst I do that). 

I've been told that there was a fix for a security issue, so it is suggested that you should update your current Android Java library files to version 10.0.2. There have been several bug fixes and additional features that have been introduced since 9.3.1. See the link to the change log below:

https://github.com/urbanairship/android-library/blob/master/CHANGELOG.md

If you can provide me with the Channel ID (use this link to find it - https://support.airship.com/hc/en-us/articles/360006723352-How-to-find-the-Channel-ID-using-the-Channel-Capture-Tool) for one or several of your Android devices you are testing this with along with the date/times when you attempted to apply the tag changes, then I can do some more digging.

Kind regards,

Chilun Liu 

Senior Technical Support Engineer Airship 

The Embassy Tea House,

195-205 Union Street, London, SE1 0LN Portland | San Francisco | London | Paris | New York | New Delhi

chilun liu 0 votes
Comment actions Permalink