CustomWebView doesn't handle everything itself, unfortunately.
You will have to configure OnPermissionRequest
event and GrantPermission
method accordingly.
Here is an example
Taifun
I've tested OnPermissionRequest
and GrantPermission
but it dind't work.
The 'OnPermissionRequest' event is not even called.
I've tried to grant permissions using this:
Can it be that CustomWebView doesn't support Web NFC?
Best Regards,
Rui
There is lack of information for this feature.
in this answer javascript - How do you obtain permissions from web-nfc API? - Stack Overflow there is a link to a sample page Web NFC Sample which might help?
Taifun
We based our website that reads NFC tags on the examples you mentioned @Taifun.
It works fine on Chrome, but when we use WebViewer or CustomWebView it doesn't work.
Rui
Apparently the error message ""NotAllowedError: NFC permission request denied." is not due to lack of permissions, but because WebViewer and CustomWebView don't support WebNFC.
Best Regards,
Rui
Yes, they don't support WebNFC.
Hi @vknow360, good evening.
I'm using the latest version of CustomWebView (12.0beta). Do you know if WebNFC is now supported?
Best Regards,
Rui
According to MDN documentation, WebView for Android is supported.
There is enough information here to answer your question.
Hello @TIMAI2.
I was asking again because I've installed a new version of CustomWebView (12.0beta).
This one is fairly recent.
Best Regards,
Rui
I found this post as I happened to be trying this out for the first time.
I see it is definitely a catch error triggered by the NFC scan function within my Javascript function.
I am digging around the Internet looking for solutions. One thing, which I cannot answer but maybe others who have webview expertise can. Namely does webview use WebChromeClient. i.e. is this set or can I set it: webView.webChromeClient = mWebChromeCient
@Gerriko_io, are you using WebViewer or CustomWebView ?
CustomWebView seems to be much more powerfull, but I didn't get it to work with NFC.
But there is now a new version of CustomWebView (12.0beta), that's why I was asking if this one works with WebNFC.
Rui
You only answered your question in the other replies.
Hello @Gerriko_io, good morning.
If you manage to get this working, please let me know. I've done lots of tests, but it always failed.
Best Regards,
Rui
I did several tests but couldn't get it working. I am sure Chrome and other browsers use their own implementation of webview, enabling much more functionalities.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.