Skip to content

Commit 81e2bb0

Browse files
author
Cube
authored
Merge pull request #93 from Dynamsoft/_dev
found 'Notification' incompatibility in IOS(test in IOS16);
2 parents 1810348 + e7c5bb7 commit 81e2bb0

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

1.hello-world/10.read-video-pwa/helloworld-pwa.html

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ <h1 style="font-size: 1.5em;">Hello World for PWA</h1>
4646
}
4747

4848
(async function() {
49-
Notification.requestPermission().then((result) => {
50-
if (result === 'granted') {
51-
startNotificationLoop();
52-
}
53-
});
49+
if(window.Notification) {
50+
Notification.requestPermission().then((result) => {
51+
if (result === 'granted') {
52+
startNotificationLoop();
53+
}
54+
});
55+
}
5456
try {
5557
const scanner = await (pScanner = pScanner || Dynamsoft.DBR.BarcodeScanner.createInstance());
5658
scanner.onFrameRead = results => {

0 commit comments

Comments
 (0)