android - 将来自 CustomTabsIntent 授权的 facebook 登录返回给应用程序
问题描述
我的应用程序打开网页以登录应用程序抛出 webview。此页面包含额外的登录抛出 facebook。facebook https://developers.facebook.com/docs/facebook-login/android/deprecating-webviews的最新更改不允许在一个 web 视图中打开 facebook 登录页面。所以我创造
webview.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.contains("facebook")) {
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.intent.setFlags(FLAG_ACTIVITY_NEW_TASK);
customTabsIntent.launchUrl(getApplicationContext(), Uri.parse(url));
return true;
}
}
但是我怎样才能返回我的登录页面并检索 Facebook 授权?
授权有效,但它会在新的 chrome 选项卡中打开我的数据,而不是在我的应用程序中。
解决方案
推荐阅读
- oracle11g - urc_id_SEQ.nextval 给出无效标识符错误?
- spring - Spring 3 RestTemplate 到 WebClient
- html - 一个小提琴上的选项值图像有效,但我的新副本无效
- java - 是否可以获得我的 android 设备的 NFC 正在生成的 ID?
- java - Spring 测试模拟和对象引用未保存的瞬态实例
- javascript - 根据javascript中的条件更改表格字母颜色
- scala - 斯卡拉“属于”功能
- c++ - 问题 C++ 逆波兰表示法计算器
- .net - 禁用父对象时,Windows 窗体工具提示属性“ShowAlways”不起作用
- python - Numpy:根据键自动将 .npz 中的文件加载到新变量