Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twitter Call back URL

Tags:

I am working with twitter SDK to integrate with in ios app.When i follow all the step and create the customer key and put it in my app.When I run the app it show "[TwitterKit] did encounter error with message

"Error obtaining user auth token.": Error Domain=TWTRLogInErrorDomain Code=-1 "Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings" UserInfo={NSLocalizedDescription=Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings"

How to resolve this?

like image 681
Yaseen khan Avatar asked May 30 '18 09:05

Yaseen khan


People also ask

What is a Twitter callback URL?

As users work through these flows, they need a web page or location to be sent to after they have successfully logged in and provided authorization to the developer's App. This follow-up webpage or location is called a callback URL.

How can I get callback URL?

The Callback URL is simply the location that you want Facebook to deliver messages to. For example: if you are running a server at https://my_awesome_service.com and you want it to receive facebook updates, you would first create a route (let's say /v1/facebook_subscriptions ) in your service.

What is a callback URL in OAuth?

A callback URL is the URL that is invoked after OAuth authorization for the consumer (connected app). In some contexts, the URL must be a real URL that the client's web browser is redirected to.


1 Answers

I had the same problem and the TwitterKit documentation is not accurate or Twitter has changed their policies. In any case, on the Twitter Apps site, the callback URL has to be set very specifically. The callback URL should be in the format:

twitterkit-{consumer/api key}:// 

For example:

twitterkit-128238aKjqlp123AKdasdf:// 

Also, this needs to be registered in your Info.plist exactly the same:

<dict> <key>CFBundleURLSchemes</key> <array>     <string>twitterkit-128238aKjqlp123AKdasdf</string> </array> </dict> 

More documentation is listed here: https://developer.twitter.com/en/docs/basics/callback_url.html

like image 135
David J Avatar answered Dec 27 '22 19:12

David J