Problems reading NFC Card

You will need a webviewer which is able to ask for that permission... did you try the custom webviewer extension @vknow360 ?

However I'm not sure, if this permission is available there

Taifun

Hello Taifun.

Just tested the custom webviewer extension but it also doesn't ask for the permission.

The full error message is "Error: NotAllowedError: NFC permission request denied."

Rui

Please show the relevant blocks.

Hello @vknow360.

In terms of code blocks is very simple:

image

All the code to read the NFC Tag is in the webpage.

Basically it's the scan example you can find here:

In Chrome it shows something similar to this:

image

Rui

CustomWebView doesn't handle everything itself, unfortunately.
You will have to configure OnPermissionRequest event and GrantPermission method accordingly.

Here is an example

Taifun

Thank you very much @vknow360 and @Taifun.

I will test it and let you know!

Hello @vknow360 & @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:

image

Can it be that CustomWebView doesn't support Web NFC?

Best Regards,
Rui

Hello @vknow360 & @Taifun.

Did you have a chance to take a look at this?

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

Hello @Taifun & @vknow360.

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