Hello, good afternoon.
To better control the way our users access the internet, we developed an App that uses the WebViewer component to create a "mini-browser" that can only access a list of sites we allow.
Now, we developed a website that uses Web NFC to read NFC Tags. The site works perfectly in Chrome (it shows a popup asking for NFC permissions), but when open it in the WebViewer, it displays a "NO NCF Permissions" error, an no popup message appears.
Can anyone help me?
Best Regards,
Rui
TIMAI2
October 19, 2022, 4:05pm
2
Perhaps dragging in the NFC component from the Palette will provide the permission ?
That was my first idea, but it didn't work.
I even called the Ask for Permission function, but it was automatically granted.
It goes automatically to the permission granted Event.
Without any user input.
Taifun
October 19, 2022, 6:53pm
4
You will need a webviewer which is able to ask for that permission... did you try the custom webviewer extension @vknow360 ?
Download latest version here
1.Introduction
It is an extended version of web viewer with more customization and flexibility. Its customization and additional features make it different and much more better than Web Viewer from the perspective of App Developer as well as User.
Note: CustomWebView can work only on devices running on at least Android 5.0
Latest Version : 12
Required Api : 21
Released: 2020-05-12T18:30:00Z (UTC)
Last Updated: 2023-03-08T18:30:00Z (UTC)
2.Features
More cus…
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:
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:
Rui
CustomWebView doesn't handle everything itself, unfortunately.
You will have to configure OnPermissionRequest
event and GrantPermission
method accordingly.
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:
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.
Taifun
November 4, 2022, 2:34pm
14
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.
The NDEFReader interface of the Web NFC API is used to read from and write data to compatible NFC devices, e.g. NFC tags supporting NDEF, when these devices are within the reader's magnetic induction field.
TIMAI2
December 2, 2022, 1:34pm
20
vknow360:
don't support WebNFC
There is enough information here to answer your question.