fix(ios): update capacitor config and fix plugin initialization

Updated Capacitor configuration and HTML initialization:

Capacitor Config:
- Changed webDir from 'www' to 'public' to match actual directory structure
- Config now correctly points to App/App/public/ directory

HTML Initialization:
- Removed immediate plugin assignment (was failing because Capacitor not loaded)
- Added Capacitor script tags (capacitor.js, capacitor_plugins.js)
- Added initialization script that waits for Capacitor to be ready
- Plugin is now set after Capacitor loads successfully

Fixes:
- Black screen: Capacitor scripts now load before plugin access
- Plugin errors: window.Capacitor was undefined, now waits for it
- Initialization: Proper async loading of Capacitor runtime

Note: capacitor.js and capacitor_plugins.js will be generated by Capacitor
during build or can be copied from node_modules if needed
This commit is contained in:
Matthew Raymer
2025-11-11 20:07:03 -08:00
parent 4b239e7faf
commit 194029423b
2 changed files with 2 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
{
"appId": "com.timesafari.dailynotification",
"appName": "DailyNotification Test App",
"webDir": "www",
"webDir": "public",
"server": {
"androidScheme": "https"
},

View File

@@ -83,9 +83,7 @@
console.log('Script loading...');
console.log('JavaScript is working!');
// Use real DailyNotification plugin
console.log('Using real DailyNotification plugin...');
window.DailyNotification = window.Capacitor.Plugins.DailyNotification;
// DailyNotification will be set after Capacitor loads (see initialization script at end)
// Define functions immediately and attach to window
function testPlugin() {