Inside of a template page of f7 i have a script running and deviceready is not firing inside since i dont get anything in my console. It works fine if i dont include ondeviceready but i have to use it for the local notification plugin. I am trying to get a notification when i press the btnzaaltoevoegen button.
<template>
<div class="page" data-name="light">
<div class="navbar">
<div class="navbar-bg"></div>
<div class="navbar-inner sliding">
<div class="title" id="logoutDiv">
Zaal Toevoegen
<a class="btnLogout" id="logoutzaal"
><i class="fas fa-sign-out-alt logoutButton"></i
></a>
<script>
document
.getElementById("logoutzaal")
.addEventListener("click", function () {
window.location.href = "../index.html";
});
</script>
</div>
</div>
</div>
<div class="page-content">
<button id="btnZaalToevoegen">Voeg zaal toe</button>
<script>
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
document
.getElementById("btnZaalToevoegen")
.addEventListener("click", function () {
//#region noti
cordova.plugins.notification.local.schedule({
title: "My first notification",
text: "Thats pretty easy...",
foreground: true,
});
</div>
</template>