Callback After Twitter Authentication
Solution 1:
Ok, it was quite a dumb mistake.
My <intent-filter>
wasn't inside an application..
This is how it is now:
<activityandroid:name=".OAuthForTwitter"android:label="@string/app_name"android:configChanges="orientation|keyboardHidden"android:launchMode="singleInstance"><intent-filter><actionandroid:name="android.intent.action.VIEW"></action><categoryandroid:name="android.intent.category.DEFAULT"></category><categoryandroid:name="android.intent.category.BROWSABLE"></category><dataandroid:scheme="sosInternational"android:host="OAuthForTwitter"></data></intent-filter></activity>
This kind off works, it just loads the whole app from start.
Isn't there a way to just 'go back' to the last activity without restarting the whole app?
Solution 2:
I have solved this. Not exactly the way you have developed, but a slight different way. Here are the steps describing what i did.
Use webview instead of opening it in web browser: One of the key advantage doing it is , you can track the url redirects.
call
setWebViewClient
method of your webview and overrideshouldOverrideUrlLoading
method of your class, i have used inner class.You will have url parameter in your method. Check whether it starts with your own call back url or not, (Note: This url contains User Token and user secret that is necessary for authorization).
After you finish your task, you can hide the activity or remove the webView or any thing you desire.
EDIT : This is the oAuth way usually used in web application, so we don't need xAuth way. (In case other community members don't know)
Hope it will help you.
Solution 3:
Your callback URL should be "sosInternational://HierBenIkNu" (instead of "sosInternational:///HierBenIkNu") in the Java code.
privatefinalStringCALLBACKURL="sosInternational://HierBenIkNu";
Post a Comment for "Callback After Twitter Authentication"