2012-04-06 5 views
1

Ich habe ein Problem Oauth in Android mit signpost Bibliothek implementieren. Alles ist gut, außer dem letzten Teil, wenn es nach dem Gewähren des Zugriffs zu der Anwendung selbst zurückkehren soll.Android Google Oauth: nicht zurück zu Anwendung nach dem Erteilen von Zugriff

Unter meiner Tätigkeit Rückruf Erklärung in manifest ist:

<activity android:name="ro.locationsApp.android.login.LoginScreenActivity" 
     android:screenOrientation="portrait" 
     android:launchMode="singleTask"> 
     <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="http" android:host="myCallbackHost"/> 
     </intent-filter> 
    </activity> 

Und ich den Callback URL übergeben von Code wie folgt:

new OAuthHelper("mySite", "secret", 
     "https://www.googleapis.com/auth/userinfo.profile", "http://myCallbackHost"); 

Wo myCallbackHost es eine echte und funktionale Verbindung ist (es wird auch verwendet, für Rückruf nach einer Website-Authentifizierung - jetzt möchte ich auch Handy).

Das Problem ist, dass meine Android-App danach nicht aufgerufen wird. Ich habe auch versucht

<data android:scheme="customScheme"/> 

und

new OAuthHelper("mySite", "secret", 
    "https://www.googleapis.com/auth/userinfo.profile", "customScheme:///"); 

aber ohne Erfolg.

Danke,

Alex.

Antwort

0

Ändern von http mit etwas anderes funktioniert.

Hier ist, wie mein Manifest sieht jetzt:

<activity android:name="ro.locationsApp.android.login.LoginScreenActivity" 
    android:screenOrientation="portrait" 
    android:launchMode="singleTask"> 
    <intent-filter> 
     <category android:name="android.intent.category.LUNCHER" /> 
    </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:scheme="alex" android:host="me"/> 
    </intent-filter> 
</activity> 

und Code:

new OAuthHelper("mySite", "secret", 
"https://www.googleapis.com/auth/userinfo.profile", "alex://me"); 

funktioniert wie ein Zauber.

+0

haben Sie das gleiche in Android ICS – nicky

+0

ja überprüft, auf Sony Ericsson Xperia Arc S, mit ICS installiert und es funktioniert –