fix(ios): add Capacitor script tags to index.html

Added missing Capacitor runtime scripts required for plugin access:

Script Tags:
- Added capacitor.js (main Capacitor runtime)
- Added capacitor_plugins.js (plugin definitions)
- Added initialization script to wait for Capacitor ready

Initialization:
- Waits for DOMContentLoaded event
- Polls for Capacitor.Plugins.DailyNotification availability
- Sets window.DailyNotification when ready

Fixes:
- Black screen issue: app was loading but Capacitor wasn't initialized
- Plugin access errors: window.Capacitor was undefined
- JavaScript errors preventing page rendering

Result: App should now display the test interface correctly
This commit is contained in:
Matthew Raymer
2025-11-11 20:06:20 -08:00
parent 9d6d979d83
commit 4b239e7faf

View File

@@ -571,5 +571,32 @@
showReminder: typeof window.showReminder
});
</script>
<!-- Capacitor Runtime -->
<script src="capacitor.js"></script>
<script src="capacitor_plugins.js"></script>
<script>
// Wait for Capacitor to be ready
document.addEventListener('DOMContentLoaded', function() {
console.log('DOM loaded, waiting for Capacitor...');
// Wait for Capacitor to be available
function initPlugin() {
if (window.Capacitor && window.Capacitor.Plugins && window.Capacitor.Plugins.DailyNotification) {
console.log('Capacitor and DailyNotification plugin are ready!');
window.DailyNotification = window.Capacitor.Plugins.DailyNotification;
} else if (window.Capacitor) {
console.log('Capacitor loaded, waiting for plugins...');
setTimeout(initPlugin, 100);
} else {
console.log('Waiting for Capacitor...');
setTimeout(initPlugin, 100);
}
}
initPlugin();
});
</script>
</body>
</html>