Activity URL callback not working in 4.0.3 ICS
Asked Answered
S

5

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.

Simulcast answered 31/5, 2012 at 1:21 Comment(2)
+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.Spot
@Spot - were you guys able to find a solution for this ?Ary
P
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>
Probation answered 29/5, 2014 at 7:29 Comment(0)
M
0

Make sure your CALLBACK_URL is

myapp://myactivity
Maintenance answered 29/10, 2013 at 8:53 Comment(0)
A
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>
Ake answered 22/4, 2014 at 9:7 Comment(0)
S
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/

Stateless answered 29/4, 2014 at 14:15 Comment(0)
M
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>
Medium answered 27/5, 2014 at 6:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.