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?
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.
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.
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.
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
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