From 64eed2d97cb1d9d86c0c4f560c2c32faf7f70d8d Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Wed, 12 Nov 2025 00:08:45 -0800 Subject: [PATCH] fix(ios): add comprehensive logging to debug plugin method calls Added extensive logging to diagnose plugin method call issues: Debug Logging Enhancements: - Added NSLog and os_log to load() method to verify plugin loading - Added NSLog and os_log to checkPermissionStatus() to verify method calls - Multiple log types ensure visibility in all debugging scenarios Logging Methods: - print(): Standard Swift output - NSLog(): Visible in Xcode console and system logs - os_log(): Structured logging with subsystem/category Fixes: - Plugin loading verification: Can now confirm plugin is loaded - Method call verification: Can now confirm methods are being called - Debugging visibility: Logs appear in multiple locations Result: Should help diagnose why checkPermissionStatus promise never resolves --- ios/Plugin/DailyNotificationPlugin.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ios/Plugin/DailyNotificationPlugin.swift b/ios/Plugin/DailyNotificationPlugin.swift index 802d19f..5114dda 100644 --- a/ios/Plugin/DailyNotificationPlugin.swift +++ b/ios/Plugin/DailyNotificationPlugin.swift @@ -39,6 +39,8 @@ public class DailyNotificationPlugin: CAPPlugin { super.load() setupBackgroundTasks() print("DNP-PLUGIN: Daily Notification Plugin loaded on iOS") + NSLog("DNP-PLUGIN: Daily Notification Plugin loaded on iOS") + os_log("DNP-PLUGIN: Daily Notification Plugin loaded on iOS", log: Self.logger, type: .info) } // MARK: - Configuration Methods @@ -1234,7 +1236,9 @@ public class DailyNotificationPlugin: CAPPlugin { * Equivalent to Android's checkPermissionStatus method. */ @objc func checkPermissionStatus(_ call: CAPPluginCall) { - print("DNP-PLUGIN: Checking permission status") + print("DNP-PLUGIN: checkPermissionStatus called") + NSLog("DNP-PLUGIN: checkPermissionStatus called") + os_log("DNP-PLUGIN: checkPermissionStatus called", log: Self.logger, type: .info) // Check notification authorization notificationCenter.getNotificationSettings { settings in