我在使用路标库在 Android 中实现 Oauth 时遇到问题。一切都很好,除了最后一部分,它应该在授予访问权限后返回应用程序本身。
下面是我在清单中的活动回调声明:
<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>
我从这样的代码中传递回调 URL:
new OAuthHelper("mySite", "secret",
"https://www.googleapis.com/auth/userinfo.profile", "http://myCallbackHost");
myCallbackHost 它是一个真实的功能链接(它也用于网站身份验证后的回调 - 现在我也想要移动设备)。
问题是我的 android 应用程序在此之后没有被调用。我也试过
<data android:scheme="customScheme"/>
和
new OAuthHelper("mySite", "secret",
"https://www.googleapis.com/auth/userinfo.profile", "customScheme:///");
但没有成功。
谢谢,
亚历克斯。