A
A
Andrew2021-08-16 17:34:53
Android
Andrew, 2021-08-16 17:34:53

How to make telegram login widget work in android webview?

There is a webview project in android studio. The site has an authorization plugin through widget telegram.
https://core.telegram.org/widgets/login
Authorization works through the browser, if you use webview it gives

bot domain invalid

611a769fc3a83634073893.png

All basic "settings" are included:
mWebView.getSettings().setDomStorageEnabled(true);
                        mWebView.getSettings().setJavaScriptEnabled(true);
                        mWebView.getSettings().setLoadsImagesAutomatically(true);
                        CookieManager.getInstance().setAcceptCookie(true);
                        mWebView.getSettings().setAppCacheEnabled(true);
                        mWebView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);


If you write the following, the widget is not called (I myself have not used such settings in webview projects for the last 3 years):
mWebView.getSettings().setSupportMultipleWindows(true); mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);


Usually, a bot domain invalid error is issued if the domain is not linked to the bot in the botfaser. But here the problem is with webview. Who will prompt where to dig?
Thank you.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question