Unable to use twitter login when phone has no Twitter App installed

android

#1

Hi,

My application uses twitter login and uses the twitter profile of the user in order to create an account. If the phone has the twitter app installed my app opens the twitter app when the android TwitterLoginButton is pressed and the process goes smoothly. However, when there is no twitter app installed I get a short loading screen which then closes immediately and get the following error in the logs:

witter: Invalid json: <?xml version="1.0" encoding="UTF-8"?>Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

From what I understand the twitterkit will fallback on opening a webview when the twitter app is installed. But I get this error where the callback URL is not approved. I have tried setting a callback url but I keep on getting this error. Where do I get/generate the correct callback URL for my Android app so webview login will work? Thanks


#2

try to add twittersdk:// to the Callback URLs of your app settings in https://apps.twitter.com


#3

Thanks. It finally works after scouring the internet for answers.


#4

How did you fix that?

Thanks


#6

To Fix this issue do as below:

[Mandatory]

Add CallbackURL into the dashboard as below format:

For iOS:

twitterkit-CONSUMERKEY://

For Android:

twittersdk://

Help Link:

[ Note: Please replace your consumer key in place of words “CONSUMERKEY” in above format]