From 194029423be1ecbce4d501e12ee14c03c2a9476e Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Tue, 11 Nov 2025 20:07:03 -0800 Subject: [PATCH] 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 --- test-apps/ios-test-app/App/App/capacitor.config.json | 2 +- test-apps/ios-test-app/App/App/public/index.html | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/test-apps/ios-test-app/App/App/capacitor.config.json b/test-apps/ios-test-app/App/App/capacitor.config.json index b9ae162..27aec06 100644 --- a/test-apps/ios-test-app/App/App/capacitor.config.json +++ b/test-apps/ios-test-app/App/App/capacitor.config.json @@ -1,7 +1,7 @@ { "appId": "com.timesafari.dailynotification", "appName": "DailyNotification Test App", - "webDir": "www", + "webDir": "public", "server": { "androidScheme": "https" }, diff --git a/test-apps/ios-test-app/App/App/public/index.html b/test-apps/ios-test-app/App/App/public/index.html index a76cc15..b5b7e68 100644 --- a/test-apps/ios-test-app/App/App/public/index.html +++ b/test-apps/ios-test-app/App/App/public/index.html @@ -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() {