I don't success to use the Twitter API connection in iOS with Objective-C. I use that codes:
[[Twitter sharedInstance] logInWithCompletion:^
(TWTRSession *session, NSError *error) {
if (session) {
NSLog(@"");
}}];
In my AppDelegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Twitter
[[Twitter sharedInstance] startWithConsumerKey:@"z0F**************cg" consumerSecret:@"PJu*******************N6W"];
- (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options {
return [[Twitter sharedInstance] application:app openURL:url options:options];
return NO;
}
I precise that openURL is never called.
I obtain several error message that I don't understand:
Error Domain=TWTRNetworkingErrorDomain Code=-1011 "Request failed: unauthorized (401)" UserInfo={NSLocalizedFailureReason=Twitter API error : <?xml version="1.0" encoding="UTF-8"?>
<hash>
<error>Desktop applications only support the oauth_callback value 'oob'</error>
<request>/oauth/request_token</request>
</hash>
(code (null)), TWTRNetworkingStatusCode=401, NSErrorFailingURLKey=https://api.twitter.com/oauth/request_token, NSLocalizedDescription=Request failed: unauthorized (401)}
AND:
[TwitterKit] did encounter error with message "Error obtaining user auth token.": Error Domain=TWTRLogInErrorDomain Code=-1 "<?xml version="1.0" encoding="UTF-8"?>
<hash>
<error>Desktop applications only support the oauth_callback value 'oob'</error>
<request>/oauth/request_token</request>
</hash>
" UserInfo={NSLocalizedDescription=<?xml version="1.0" encoding="UTF-8"?>
<hash>
<error>Desktop applications only support the oauth_callback value 'oob'</error>
<request>/oauth/request_token</request>
</hash>
}
It seems that it is not connected, I see a lot of things in Swift, but nothing in Objective-C.
Thanks in advance.
I get this error when i am try to integrate twitter login in my app
Solution :
1. When you create app on developer account of twitter, that time Callback Url field is not wants to empty. If this field is empty that time this issue comes so to overcome on this issue please don't be empty this callback url field.
Happy Coding....!!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With