User token become nil after property update

I have a situation where the user registers, logs in, selects one tab from the tab bar controller that contains his profile, fills in the information and hits save. This creates a profile object which is a property in the user table. The code I execute is the following:
print(“token before update ( backendless.userService.currentUser.getUserToken())”)
loggedInUser.updateProerties([“userProfile”:userProfile])
backendless.userService.update(loggedInUser, response { (user:BackendlessUser!) in
print(" User has been updated: (user.getUserToken()) \ncurrentUser -> (self.backendless.userService.currentUser.getUserToken())")
}, error:{(error:Fault!) in
print(“could not update user (error)”)
})
Both of these properties are nil for both the updated use and the current user. the print statement before the update gest the user token back correctly. After the update call I loose access to the user’s token.
Please let me know how to resolve this.
Thank you in advance
George

Any comment on this issue?

Regards,

George

Please update the latest Backendless SDK via pod (3.0.32 release) or from iOS-Samples github (CommLObiOS and backendless).

Hi George,

Server returns the user token ONLY for login(…), not for other functions.
After user is logged in, you can check if its user token is valid with IsValidUserToken().

Regards,
Slava

Hi Slava,

I have the latest sdk installed already. Let me make sure I understand you correctly, if I make the following call anywhere in my code backendless.userService.currentUser.getUserToken() I am not going to receive the user token?

Because when I run the code mentioned above before the update
print(“token before update ( backendless.userService.currentUser.getUserToken())”) I get a token back.

If that is the case then I have to store globally the user token after login let say in the application delegate by executing what code isvalidUserToken() which I can get as a string?

Regards,

George

Hi George,

We have fixed this issue, now you could update backendless.a lib from ios-SDK github.
Please try it with your app again and let we know how it goes for you.

Regards,
Slava

Hi Slava,

Thank you, I will try it and get back to you.

Regards,

George

Hi Slava,

I tried it out and seems to be working as expected.

Thank you.

Regards,

George