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
This commit is contained in:
Matthew Raymer
2025-11-11 20:26:40 -08:00
parent d5ddb6e20e
commit abfa1029a4
2 changed files with 15 additions and 1 deletions

View File

@@ -11,7 +11,7 @@
<!--Bridge View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="CAPBridgeViewController" customModule="Capacitor" sceneMemberID="viewController"/>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="App" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>

View File

@@ -22,6 +22,20 @@ class ViewController: CAPBridgeViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Debug: Print bridge configuration
print("ViewController: Bridge initialized")
if let bridge = self.bridge {
print("ViewController: Bridge found")
if let webView = bridge.webView {
print("ViewController: WebView found: \(webView)")
print("ViewController: WebView URL: \(webView.url?.absoluteString ?? "nil")")
} else {
print("ViewController: WebView is nil!")
}
} else {
print("ViewController: Bridge is nil!")
}
// Initialize Daily Notification Plugin demo fetcher
// This is called after Capacitor bridge is initialized
initializePlugin()