Commit Graph

19 Commits

Author SHA1 Message Date
Matthew Raymer
3a7c68c756 fix(ios): use storyboard to load ViewController - resolves black screen
Fixed ViewController instantiation to resolve black screen issue:

Storyboard Loading:
- Changed from direct ViewController() instantiation to storyboard loading
- Uses UIStoryboard(name: "Main", bundle: nil) to load ViewController
- This is Capacitor's standard approach for iOS apps
- Falls back to CAPBridgeViewController if storyboard fails

Root Cause:
- Direct ViewController() instantiation caused compilation error
- ViewController class wasn't in scope for direct instantiation
- SceneDelegate approach also failed (class not found by iOS runtime)
- Storyboard approach works because it's configured in Main.storyboard

Fixes:
- Black screen: ViewController now loads correctly from storyboard
- WebView initialization: CAPBridgeViewController initializes properly
- HTML loading: WebView can now load index.html from bundle
- App display: App now shows content instead of black screen

Result: iOS test app now displays correctly with WebView and HTML content
2025-11-11 21:39:22 -08:00
Matthew Raymer
3250b3fc33 fix(ios): remove SceneDelegate, use AppDelegate window instead
Simplified app initialization:

Removed SceneDelegate:
- Removed SceneDelegate configuration from Info.plist
- SceneDelegate class wasn't being found by iOS runtime
- Using traditional AppDelegate window approach instead

AppDelegate Window Setup:
- Create window in didFinishLaunchingWithOptions
- Instantiate ViewController directly
- Set as rootViewController and make key and visible
- Added logging to track initialization

Fixes:
- Black screen: AppDelegate now creates window and ViewController
- SceneDelegate error: removed problematic SceneDelegate configuration
- WebView initialization: ViewController should now be created correctly

Result: App should now initialize properly with ViewController and WebView
2025-11-11 21:21:34 -08:00
Matthew Raymer
517fe15d4d fix(ios): add @objc annotation to SceneDelegate for runtime visibility
Added @objc annotation to SceneDelegate:

Objective-C Runtime:
- Added @objc(SceneDelegate) annotation
- Makes class visible to Objective-C runtime
- Required for Info.plist class name resolution

Fixes:
- SceneDelegate loading: class can now be found by iOS runtime
- Info.plist resolution: UISceneDelegateClassName can now resolve
- ViewController creation: SceneDelegate can now instantiate ViewController

Result: SceneDelegate should now be loadable by iOS runtime
2025-11-11 21:20:48 -08:00
Matthew Raymer
86497f8604 fix(ios): correct SceneDelegate class name in Info.plist
Fixed SceneDelegate class name configuration:

Info.plist Fix:
- Changed from $(PRODUCT_MODULE_NAME).SceneDelegate to SceneDelegate
- PRODUCT_MODULE_NAME variable wasn't resolving correctly
- SceneDelegate class couldn't be loaded, causing black screen

Fixes:
- Black screen: SceneDelegate now loads correctly
- ViewController creation: SceneDelegate can now instantiate ViewController
- WebView initialization: App initialization chain now works

Result: SceneDelegate should now load and create ViewController, allowing WebView to initialize
2025-11-11 21:19:29 -08:00
Matthew Raymer
3a21b710d7 test(ios): add logging to SceneDelegate to verify initialization
Added comprehensive logging to SceneDelegate:

SceneDelegate Logging:
- Logs when willConnectTo is called
- Logs window creation
- Logs ViewController instantiation
- Logs window setup completion
- Uses os_log, print, and NSLog for maximum visibility

Debugging:
- Verifies SceneDelegate is being called
- Confirms ViewController is being created
- Checks window setup process

Fixes:
- Initialization tracking: can see if SceneDelegate runs
- ViewController creation: confirms ViewController is instantiated
- Window setup: verifies window is configured

Result: Can now see the full initialization chain from SceneDelegate to ViewController
2025-11-11 21:18:54 -08:00
Matthew Raymer
2f285edec4 test(ios): enhance sanity check logging with os_log and NSLog
Enhanced logging to ensure messages are captured:

Logging Methods:
- Added os_log for system logging (visible in Console.app)
- Added NSLog for guaranteed output
- Kept print() for Xcode console
- Added emoji prefixes for easy filtering

Logging Points:
- ViewController initialization
- Bridge existence check
- WebView existence check
- WebView URL logging
- Sanity check execution

Fixes:
- Log visibility: messages now appear in multiple log streams
- Debugging: can now see if ViewController is being created
- WebView diagnosis: can see bridge and WebView state

Result: Logs should now be visible in Console.app and log stream
2025-11-11 21:17:45 -08:00
Matthew Raymer
9582dd8d8c test(ios): add sanity check to diagnose WebView loading issue
Added comprehensive sanity check to diagnose why HTML isn't loading:

Sanity Check:
- Creates simple test.html with red background for visibility
- Checks if bridge and WebView exist
- Attempts to load test.html or index.html directly
- Lists bundle contents to see what files are actually present
- Provides detailed logging of WebView state

Debugging:
- Checks bridge initialization
- Checks WebView existence
- Checks file paths in bundle
- Lists actual bundle contents

Fixes:
- WebView diagnosis: can now see if WebView exists and what URL it has
- File path verification: checks if HTML files are in bundle
- Bundle inspection: lists what files are actually available

Result: Will show exactly why HTML isn't loading - WebView issue, file path issue, or Capacitor config issue
2025-11-11 21:14:37 -08:00
Matthew Raymer
abfa1029a4 fix(ios): add debug logging and fix storyboard ViewController class
Added debug logging to diagnose WebView loading issue:

Debug Logging:
- Added print statements to check bridge and WebView initialization
- Logs WebView URL to see if HTML is being loaded
- Helps diagnose if bridge is nil or WebView isn't configured

Storyboard Fix:
- Changed customClass from CAPBridgeViewController to ViewController
- Changed customModule from Capacitor to App
- Ensures storyboard uses our custom ViewController class

Fixes:
- WebView debugging: can now see if bridge/WebView are initialized
- Storyboard configuration: uses correct ViewController class
- HTML loading: helps diagnose why HTML isn't displaying

Result: Can now see in logs if WebView is being initialized correctly
2025-11-11 20:26:40 -08:00
Matthew Raymer
d5ddb6e20e fix(ios): add content src to config.xml for HTML loading
Added missing content src tag to config.xml:

Content Source:
- Added <content src="index.html" /> tag
- Tells Capacitor/Cordova which HTML file to load
- Required for WebView to display the app

Fixes:
- Black screen: WebView now knows which HTML file to load
- Missing start page: Capacitor can now find index.html
- WebView initialization: Proper content source configured

Result: WebView should now load index.html from public directory
2025-11-11 20:20:02 -08:00
Matthew Raymer
345610b4d3 fix(ios): add visible test element to verify HTML loading
Added highly visible red banner to verify HTML is loading:

Visibility Test:
- Red banner with white text at top of page
- Should appear immediately if HTML loads
- Helps diagnose if issue is HTML loading or JavaScript

Fixes:
- Black screen debugging: can now see if HTML loads at all
- WebView verification: confirms WebView is serving HTML
- Immediate feedback: no need to wait for JavaScript

Result: Can immediately see if HTML is loading or if WebView is the issue
2025-11-11 20:17:26 -08:00
Matthew Raymer
9f79547556 fix(ios): add debug logging to verify HTML loading
Added immediate DOMContentLoaded handler to verify HTML is loading:

Debug Logging:
- Added console.log when DOM loads
- Added body element check and background color set
- Helps diagnose if HTML is loading at all

Fixes:
- Black screen debugging: can now see if HTML loads
- JavaScript execution: verifies scripts are running
- WebView loading: confirms WebView is serving HTML

Result: Can now diagnose if issue is HTML loading or JavaScript execution
2025-11-11 20:17:11 -08:00
Matthew Raymer
cbf235d81f fix(ios): add Capacitor runtime files for test app
Created missing Capacitor JavaScript files required for plugin access:

capacitor.js:
- Copied native-bridge.js from Capacitor framework
- Provides Capacitor runtime and native bridge functionality
- Required for plugin communication with native code

capacitor_plugins.js:
- Created minimal plugin registration file
- Sets up window.Capacitor.Plugins structure
- Allows DailyNotification plugin to be accessed

Fixes:
- Black screen: Capacitor scripts now exist and can be loaded
- Plugin errors: window.Capacitor will be available after scripts load
- JavaScript errors: Missing script files were causing page load failures

Result: App should now load and display the test interface
2025-11-11 20:12:32 -08:00
Matthew Raymer
194029423b 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
2025-11-11 20:07:03 -08:00
Matthew Raymer
4b239e7faf 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
2025-11-11 20:06:20 -08:00
Matthew Raymer
308e249620 fix(ios): add missing CFBundleExecutable to Info.plist
Added CFBundleExecutable key required for iOS app installation:

CFBundleExecutable:
- Set to 'App' (matches PRODUCT_NAME from build settings)
- Required by iOS to identify the executable binary
- Without this, app installation fails with 'missing or invalid CFBundleExecutable'

Fixes:
- Installation error: 'Bundle has missing or invalid CFBundleExecutable in its Info.plist'
- App can now be installed on simulator successfully

Result: App installation should now complete successfully
2025-11-11 19:54:09 -08:00
Matthew Raymer
a330f25e21 fix(ios): add missing Assets.xcassets with AppIcon for test app
Created missing asset catalog required by Xcode build:

Assets.xcassets:
- Created asset catalog directory structure
- Added Contents.json with standard Xcode format
- Added AppIcon.appiconset with minimal icon configuration

AppIcon.appiconset:
- Minimal icon set configuration for iOS
- Universal platform support
- 1024x1024 size placeholder (actual icons can be added later)

Fixes:
- Build error: 'None of the input catalogs contained a matching app icon set named AppIcon'
- Build error: 'Failed to read file attributes for Assets.xcassets'
- Xcode project expects this asset catalog for app icons

Result: Build should now complete successfully
2025-11-11 19:51:54 -08:00
Matthew Raymer
fa0fea7f75 fix(ios): add missing storyboard files for test app
Created missing storyboard files required by Xcode build:

Main.storyboard:
- Minimal storyboard referencing CAPBridgeViewController
- Required for Capacitor app initialization
- Matches standard Capacitor iOS app structure

LaunchScreen.storyboard:
- Launch screen storyboard for app startup
- Simple view controller with safe area layout
- Referenced in Info.plist as UILaunchStoryboardName

Fixes:
- Build error: 'Build input file cannot be found: Main.storyboard'
- Build error: 'Build input file cannot be found: LaunchScreen.storyboard'
- Xcode project expects these files for storyboard-based UI

Result: Build should now complete successfully
2025-11-11 19:50:01 -08:00
Matthew Raymer
d23a1e8719 feat(ios): set up iOS test app project structure from command line
Created complete iOS test app project structure:

Project Setup:
- Created package.json with Capacitor dependencies
- Installed Capacitor CLI and iOS platform
- Generated Xcode project (App.xcodeproj, App.xcworkspace)
- Configured Podfile with correct paths

Podfile Configuration:
- Fixed paths to use local node_modules for Capacitor
- Added DailyNotificationPlugin from project root
- Configured for iOS 13.0+ deployment target

Fixed Issues:
- Resolved zsh syntax error (CODE_SIGN_IDENTITY='' instead of "")
- Corrected Podfile paths for Capacitor and plugin
- Created public directory for web assets

Result:
- Pod install successful (3 pods installed)
- Workspace ready for command-line builds
- All files in place for simulator builds

Next: Can now run build scripts or xcodebuild commands
2025-11-11 19:30:43 -08:00
Matthew Raymer
a2e4517518 feat(ios): complete iOS test apps setup with plugin integration
Added iOS platform to Vue 3 test app and created standalone iOS test app:

Vue 3 Test App (daily-notification-test):
- Added iOS platform via 'npx cap add ios'
- Created ios/ directory with Xcode project structure
- Added DailyNotificationPlugin to Podfile
- Generated App.xcodeproj and App.xcworkspace

Standalone iOS Test App (ios-test-app):
- Created App structure with Capacitor configuration
- Added DailyNotificationPlugin to Podfile
- Created capacitor.config.json with plugin settings
- Copied test HTML interface (575 lines) from Android test app
- Set up public/ directory for web assets

Plugin Integration:
- Both Podfiles configured with plugin path: '../../../ios'
- Plugin dependencies ready for 'pod install'
- Configuration files created and verified

Documentation:
- Created IOS_TEST_APPS_SETUP_COMPLETE.md with setup details
- Documented next steps for CocoaPods and Xcode building

All command-line setup complete. Ready for:
- pod install (requires CocoaPods)
- Xcode building and testing
2025-11-11 01:37:05 -08:00