无法在Android Webview中打开Facebook消息

时间:2017-09-25 07:45:04

标签: android facebook webview messenger

这就是我初始化Web视图的方式

    webview1.getSettings().setJavaScriptEnabled(true);
    webview1.loadUrl("https://www.facebook.com/raquel.corpusescalante");
    webview1.setWebViewClient(new WebClientClass());
    webview1.setWebChromeClient(new WebChromeClient());

这是WebClientClass

public class WebClientClass extends WebViewClient {
    ProgressDialog pd = new ProgressDialog(WebViewGeneralActivity.this);

    @Override
    public void onPageStarted(WebView view, String url, Bitmap favicon) {
        super.onPageStarted(view, url, favicon);
        if (pd != null && !pd.isShowing()) {
            pd.setTitle("Por favor espera");
            pd.setMessage("Cargando...");
            pd.show();
        }

    }
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        view.loadUrl(url);
        return true;
    }
    @Override
    public void onPageFinished(WebView view, String url) {
        super.onPageFinished(view, url);
        pd.dismiss();
    }
}

此Facebook个人资料页面完全加载,但当我点击消息图标时,它显示错误 enter image description here

这可能是什么原因

1 个答案:

答案 0 :(得分:2)

实际上它试图在Web视图中打开facebook messenger,它在webview中发送了一个意图链接,即intent:// user ....所以我通过更改代码来处理它

$this->migration->version($old_schema);