fix(ios): register DailyNotification plugin methods in capacitor_plugins.js

Fixed plugin method registration for iOS test app:

Plugin Registration Fix:
- Added proper method stubs for all DailyNotification plugin methods
- Methods use Capacitor.nativePromise to bridge to Swift implementation
- Includes permission, notification, status, channel, config, battery, and test methods

Method Registration:
- Permission: checkPermissionStatus, requestNotificationPermissions, checkPermissions, requestPermissions
- Notification: scheduleDailyNotification, getNotificationStatus, cancelAllNotifications
- Status: checkStatus
- Channel: isChannelEnabled, openChannelSettings
- Config: configure, configureNativeFetcher
- Battery/Power: getBatteryStatus, getPowerState, requestBatteryOptimizationExemption
- Exact Alarm: getExactAlarmStatus, openExactAlarmSettings
- Test: testAlarm

Fixes:
- Error: 'requestNotificationPermissions is not a function'
- Plugin methods now properly exposed to JavaScript
- Methods bridge correctly to native Swift implementation

Result: Permission buttons and other plugin methods should now work correctly
This commit is contained in:
Matthew Raymer
2025-11-11 23:12:21 -08:00
parent 328311281c
commit 04311803bc

View File

@@ -1,14 +1,75 @@
// Capacitor Plugins Registration
// This file is auto-generated by Capacitor, but we create a minimal version for testing
// This file registers the DailyNotification plugin for iOS
window.Capacitor = window.Capacitor || {};
window.Capacitor.Plugins = window.Capacitor.Plugins || {};
// Register DailyNotification plugin
// The actual plugin is registered by the native bridge
// Register DailyNotification plugin with method stubs
// Methods will be bridged to native Swift implementation
window.Capacitor.Plugins.DailyNotification = window.Capacitor.Plugins.DailyNotification || {
// Plugin methods will be available after native bridge loads
// Permission methods
checkPermissionStatus: function() {
return window.Capacitor.nativePromise('DailyNotification', 'checkPermissionStatus', {});
},
requestNotificationPermissions: function() {
return window.Capacitor.nativePromise('DailyNotification', 'requestNotificationPermissions', {});
},
checkPermissions: function() {
return window.Capacitor.nativePromise('DailyNotification', 'checkPermissions', {});
},
requestPermissions: function() {
return window.Capacitor.nativePromise('DailyNotification', 'requestPermissions', {});
},
// Notification methods
scheduleDailyNotification: function(options) {
return window.Capacitor.nativePromise('DailyNotification', 'scheduleDailyNotification', options || {});
},
getNotificationStatus: function() {
return window.Capacitor.nativePromise('DailyNotification', 'getNotificationStatus', {});
},
cancelAllNotifications: function() {
return window.Capacitor.nativePromise('DailyNotification', 'cancelAllNotifications', {});
},
// Status methods
checkStatus: function() {
return window.Capacitor.nativePromise('DailyNotification', 'checkStatus', {});
},
// Channel methods
isChannelEnabled: function(options) {
return window.Capacitor.nativePromise('DailyNotification', 'isChannelEnabled', options || {});
},
openChannelSettings: function(options) {
return window.Capacitor.nativePromise('DailyNotification', 'openChannelSettings', options || {});
},
// Configuration methods
configure: function(options) {
return window.Capacitor.nativePromise('DailyNotification', 'configure', options || {});
},
configureNativeFetcher: function(options) {
return window.Capacitor.nativePromise('DailyNotification', 'configureNativeFetcher', options || {});
},
// Battery/Power methods
getBatteryStatus: function() {
return window.Capacitor.nativePromise('DailyNotification', 'getBatteryStatus', {});
},
getPowerState: function() {
return window.Capacitor.nativePromise('DailyNotification', 'getPowerState', {});
},
requestBatteryOptimizationExemption: function() {
return window.Capacitor.nativePromise('DailyNotification', 'requestBatteryOptimizationExemption', {});
},
// Exact alarm methods
getExactAlarmStatus: function() {
return window.Capacitor.nativePromise('DailyNotification', 'getExactAlarmStatus', {});
},
openExactAlarmSettings: function() {
return window.Capacitor.nativePromise('DailyNotification', 'openExactAlarmSettings', {});
},
// Test methods
testAlarm: function(options) {
return window.Capacitor.nativePromise('DailyNotification', 'testAlarm', options || {});
}
};
console.log('Capacitor plugins file loaded');
console.log('Capacitor plugins file loaded - DailyNotification plugin registered');