Start a new topic
Answered

Twitter authentication problem: - > errorOrNil NSError! domain: "KinveyError" - code: 406

Im trying to use the twitter authentication service, but I am getting the following error. Its a bare bones application at this point so I do nothing but init kinvey, and then try authenticating with twitter. I installed the KinveyKit (1.40.7) via cocoapods yesterday.


errorOrNil NSError! domain: "KinveyError" - code: 406 0x0000000155668dd0

_userInfo __NSDictionaryI * 3 key/value pairs 0x0000000155652390

[0] (null) "KinveyKit.HTTPMethod" : "POST"

[1] (null) "NSLocalizedDescription" : "KCSPersistable objects requires the `_id` property"

[2] (null) "NSLocalizedFailureReason" : "KCSPersistable objects requires the `_id` property"


Heres the code:

 

        KCSClient.sharedClient().initializeKinveyServiceForAppKey(
            "<app key>",
            withAppSecret: "<app secret>",
            usingOptions: [
                KCS_TWITTER_CLIENT_KEY : "<key>",
                KCS_TWITTER_CLIENT_SECRET : "<secret>"
            ]
        )

 

 

        KCSUser.getAccessDictionaryFromTwitterFromPrimaryAccount { (accessDictOrNil: [NSObject : AnyObject]!, errorOrNil: NSError!) -> Void in
            if accessDictOrNil != nil {
                KCSUser.loginWithSocialIdentity(
                    KCSUserSocialIdentifyProvider.SocialIDTwitter,
                    accessDictionary: accessDictOrNil,
                    withCompletionBlock: { (user: KCSUser!, errorOrNil: NSError!, result: KCSUserActionResult) -> Void in
                        if errorOrNil != nil {
                            //handle error
                        }
                    }
                )
            }
        }

 


Best Answer

Jacob,

Can you please confirm that the “Twitter Client Key” and “Twitter Client Secret” are correct?

I had seen a similar issue when I had manually changed the Twitter key.


Thanks,
Pranav
Kinsey Support

1 Comment

Answer

Jacob,

Can you please confirm that the “Twitter Client Key” and “Twitter Client Secret” are correct?

I had seen a similar issue when I had manually changed the Twitter key.


Thanks,
Pranav
Kinsey Support

Login or Signup to post a comment