forked from remotemobprogramming/timer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix iOS issue with the notifications api
- Loading branch information
1 parent
66b7e02
commit 71ac301
Showing
2 changed files
with
17 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,8 +59,11 @@ <h1>Mob Timer</h1> | |
|
||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> | ||
<script type="text/javascript"> | ||
Notification.requestPermission(); | ||
|
||
if ("Notification" in window) { | ||
Notification.requestPermission(); | ||
} | ||
</script> | ||
<script type="text/javascript"> | ||
let url = `/events`; | ||
console.log('setting up event source at ' + url); | ||
const eventSource = new EventSource(url); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,9 @@ <h5>History <small class="text-muted">Last 24h</small></h5> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/howler/2.2.3/howler.min.js"></script> | ||
<script type="text/javascript"> | ||
Notification.requestPermission(); | ||
if ("Notification" in window) { | ||
Notification.requestPermission(); | ||
} | ||
</script> | ||
<script type="text/javascript"> | ||
|
||
|
@@ -191,13 +193,15 @@ <h5>History <small class="text-muted">Last 24h</small></h5> | |
updateTimerNextUser(requestNextUser); | ||
updateTimerType(null); | ||
|
||
Notification.requestPermission(); | ||
new Notification(requestUser + ' $ ' + (requestType === "TIMER" ? 'mob next' : 'mob start'), { | ||
tag: 'timer-finished', | ||
body: requestTimer + " min timer is up.", | ||
icon: '/favicon.ico', | ||
lang: 'en', | ||
}); | ||
if ("Notification" in window) { | ||
Notification.requestPermission(); | ||
new Notification(requestUser + ' $ ' + (requestType === "TIMER" ? 'mob next' : 'mob start'), { | ||
tag: 'timer-finished', | ||
body: requestTimer + " min timer is up.", | ||
icon: '/favicon.ico', | ||
lang: 'en', | ||
}); | ||
} | ||
|
||
if (hasAudioEnabled()) { | ||
// isTimerOfCurrentUser() ? '/' + (requestType === "TIMER" ? 'mobnext.mp3' : 'mobstart.mp3') : | ||
|