Support Topics Documentation Slack YouTube Blog

Backendless 4.0: isValidUserToken broken?

In iOS, I check if the user’s token is still valid via the .isValidUserToken function before presenting the authenticated part of the app. Today, it seems as though the call to this function is crashing the application, citing this error in iOS:

-[Fault boolValue]: unrecognized selector sent to instance 0x610000241680

It looks like the call is not returning what is expected.

When I invoke this via the rest route (specified in the 4.0 documentation):<application-id>/&lt;rest-api-key&gt;/users/isvalidusertoken/&lt;userToken&gt;

I get this parse error in postman:</img>

Is there something wrong with this token check function?

Thanks for the support,

Hello Renato,

I’ve checked this and everything works fine.

let user = backendless.userService.login("", password: "123")!
print("User logged in: \("
let isValid = backendless.userService.isValidUserToken()!
print("User token is valid: \(isValid.boolValue)")

User logged in: Optional(

User token is valid: true

Regards, Olga