2012-05-31 6 views
16

Ich verwende OAUTH in einer Twitter-App, die Sie auf die Twitter-Seite innerhalb der App sendet, wo Sie sich dann anmelden und zur App zurückgeleitet werden, wo die Token verarbeitet werden. Dies funktioniert perfekt in android 2.0.x und 3.0.x, aber in 4.0 bekomme ich "Webseite nicht verfügbar", wenn ich versuche, zurück zu meiner Anwendung umzuleiten. Kann mir jemand sagen, warum das ist? Ich habe folgend in meiner Manifest-Datei:Aktivitäts-URL-Callback funktioniert nicht in 4.0.3 ICS

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

Die Twitter-Seite wird die Callback-URL angegeben, die gearbeitet hat, aber jetzt nicht in Android 4.0 ICS, kann jemand bitte helfen? Danke.

+3

+1 +1 +1 Ich habe das gleiche Problem mit einem Telefon 4.0.3 (HTC Amaze 4G), obwohl die Weiterleitung auf alles andere funktioniert. Ich habe überall gesucht, um eine Antwort auf diese Frage zu finden. Ich gehe davon aus, dass es etwas mit den neuen Berechtigungen zu tun hat, sonst ist es ein Fehler in 4.0.3 selbst. Die Umleitung funktioniert in 4.1, aber nicht in 4.0.3. – tbjers

+0

@tbjers - habt ihr eine Lösung dafür gefunden? – DeRagan

Antwort

0

stellen Sie sicher, Ihre CALLBACK_URL ist

myapp://myactivity 
0

benutzte ich dieses und es mein Problem gelöst:

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

Das ist, was ich für die Integration von Twitter in meiner Anwendung verwendet haben. Und das funktionierte für mich Ich benutze HTC Wunsch V mit ICS 4.0.3.

Ich habe dieses Tutorial zur Integration bezeichnet. http://www.androidhive.info/2012/09/android-twitter-oauth-connect-tutorial/

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> 
1

es ist Manifesh Dateiaktivität Eintrag

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

und es ist HTML-Seite öffnen in url Verwendung gehen klicken zurück

anrufen
> <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>