Easy Twitter login doesn't work with iOS

“Enable Multiple Logins” is off. I deleted the twitter account from backendless and relogin from my app and for some reason it keeps saying that <Not existing user token - b7781fca-8f36-39e2-ff2b-615a20773a00. Relogin user to update your user token>.
And my current user has nil for objectId even though it has an email and name. when I verify it from my database every thing seems good.
my APP_ID is “5411F05B-0DB2-25EA-FFA6-7E5C69B4A200”.
Thanks for your help!

Please turn on the “Enable multiple logins” and try once more. Unfortunately I can’t check the twitter login on your app because of this error: “Unable to login user. Please ensure that you have set the valid comsimer/secret key, access token/secret and the system clock is in sync”. Please check if your twitter keys are correct.

As I can’t check the login with your application I’ve checked it from multiple devices for one user in my app and it works fine.

Regards, Olga

yeah you are right. Some how the consumer key of twitter changed in my backendless app. I fixed it and now the login works but with same problem.
we verified login with android version and It has same error “Not existing user token”.

We are working on this issue. We’ll answer as soon as we have some results.

Regards, Olga

Thank you! I will be waiting your answer.

Hello!

A new method

loginWithTwitterSDK

added to the UserService class. Please connect the Twitter kit lib (check this Twitter doc) and update the Backendless lib to the newest version 4.0.18. We’ll update our Backendless documentation as soon as possible.

Also, could I ask you to answer here whether it works fine.

Regards, Olga

Check example http://take.ms/dJxzp, please change backendless app id, api key and twitter consumer keys in AppDelegate.h file

Hi!

I did as you said and that is the code I used:
let fieldsMapping = [

“name” : “name”,

“email”: “email”,

“id”: “id”

]

Twitter.sharedInstance().logIn(completion: { (session, error) in

if (session != nil) {

self.backendless!.userService.login(withTwitterSDK: session?.userID, authTokenSecret: session?.authTokenSecret, fieldsMapping: fieldsMapping, response: { (user) in

}, error: { (fault) in

UIAlertView.init(title: “Twitter login failed”, message: fault?.message!, delegate: nil, cancelButtonTitle: “OK”).show()

})

} else {

UIAlertView.init(title: “Twitter login failed”, message: error?.localizedDescription, delegate: nil, cancelButtonTitle: “OK”).show()

}

})

But every time I try loginWithTwitterSDK I get an error that says:
“Wrong credentials for twitter. {"errors":[{"code":89,"message":"Invalid or expired token."}]}”

IMG-1235.jpg

Please check if you have the correct consumer key and secret key in the Backendless console and in your app. Also please check the example provided by Sergey below.

Regards, Olga