Fixed plugin registration to use proper Capacitor native bridge API:
API Fix:
- Changed from window.Capacitor.nativePromise to cap.nativePromise
- Added proper initialization wait for Capacitor to be available
- Wrapped in IIFE for proper scoping
Method Registration:
- All methods now use cap.nativePromise(pluginName, methodName, options)
- Methods properly bridge to native Swift implementation
- Added initialization check to wait for Capacitor if not ready
Fixes:
- Error: 'requestNotificationPermissions is not a function'
- Plugin methods now correctly call native bridge
- Proper async initialization ensures Capacitor is ready
Result: Permission buttons and all plugin methods should now work correctly