16

I am using OAUTH in a twitter app which sends you to the twitter page within the app where you then sign in and are redirected back to the app where the tokens are handled. This works perfectly in android 2.0.x and 3.0.x but in 4.0 I get "Web page not available" when I try to redirect back to my application. Can anybody tell me why this is?? I have the following in my manifest file:

<intent-filter>
    <action android:name="android.intent.action.VIEW"/> 
    <category android:name="android.intent.category.DEFAULT"/>
    <category android:name="android.intent.category.BROWSABLE"/>
    <data android:scheme="myapp" android:host="myactivity"/>
</intent-filter>

The twitter page is given the callback URL which has been working but now does not in android 4.0 ICS, can somebody please help? Thank you.

Darshan Rivka Whittle
  • 32,989
  • 7
  • 91
  • 109
Android4J
  • 181
  • 4
  • 3
    +1 +1 +1 I have the exact same problem with a 4.0.3 phone (HTC Amaze 4G) though the redirect works on everything else. I have been searching everywhere to find an answer to this one. I am assuming it has something to do with the new permissions, else it is a bug in 4.0.3 itself. The redirect works in 4.1, but not in 4.0.3. – tbjers Sep 14 '12 at 01:21
  • @tbjers - were you guys able to find a solution for this ? – DeRagan Jul 22 '13 at 16:10

5 Answers5

1

it is Manifesh file activity entry

    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data
        android:host="www.yourpage.address"
        android:scheme="alocola" />                //scheme name

</intent-filter>

and it is html page open in url use click go to call back

> <html> Visit my blog <?php $homepage =
> file_get_contents('http://www.example.com/api/parameters'); echo
> $homepage; ?>  <a href="alocola://other/parameters/here">   ////alocola use scehma
>  <metahttp-equiv="alocola://other/parameters/here"content="5;
> url="alocola://other/parameters/here" > mysite </a>  or run the   <a
> href=\"alocola"> myactivity</a>  callback</html>
Sachin C
  • 141
  • 9
0

Make sure your CALLBACK_URL is

myapp://myactivity
sais
  • 803
  • 6
  • 15
0

I used this and it solved my problem:

<intent-filter>
   <action android:name="android.intent.action.VIEW" />
   <category android:name="android.intent.category.DEFAULT" />
   <category android:name="android.intent.category.BROWSABLE" />
   <data android:scheme="x-oauthflow-twitter" android:host="callback" />
</intent-filter>
Jeff B
  • 8,572
  • 17
  • 61
  • 140
Shoaib Ahmad
  • 141
  • 1
  • 9
0
   <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:launchMode="singleTop" >

<intent-filter>

        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data
            android:host="t4jsample"
            android:scheme="oauth" />

    </intent-filter> 

This is What I have used in my application for integrating twitter. And this worked for me I am using HTC desire V with ICS 4.0.3.

I referred this tutorial for integration. http://www.androidhive.info/2012/09/android-twitter-oauth-connect-tutorial/

Raghul
  • 46
  • 7
0
<activity
        android:name=".StartupActivity"
        android:launchMode="singleTask"
         >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />

            <data
                android:host="www.healthcompanion.com"
                android:path="Common//Registration.jsp"
                android:pathPattern="*.*&amp;data=2&amp;*"
                android:scheme="https" />
        </intent-filter>
    </activity>
Sudhi S
  • 256
  • 2
  • 5