I have setup local notifications on IOS and l want to subscribe to Local notifications on the event onTrigger then l play custom audio or voice recording. Whats happening is if the app is in the foreground/active l do receive notifications and l do subscribe to event onTrigger. However if l lock my phone or place the app in the background the notification does popup but does not subscribe to the event onTrigger.
Is a a workaround to subscribe to events when the app is in the background or when device is locked? Your Environment
Device OS is IOS 16.1.2 Ionic:
Ionic CLI : 5.4.5 (/usr/local/lib/node_modules/ionic) Ionic Framework : @ionic/angular 5.9.4 @angular-devkit/build-angular : 12.1.4
Cordova:
Cordova CLI : 11.0.0 Cordova Platforms : ios 6.2.0 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 14 other plugins)
Utility:
cordova-res : 0.15.4 native-run : 1.6.0 (update available: 1.7.1)
System:
ios-deploy : 1.10.0 ios-sim : 8.0.2 NodeJS : v14.15.4 (/usr/local/bin/node) npm : 6.14.10 OS : macOS Xcode : Xcode 14.1 Build version 14B47b
Installed Plugins cordova-plugin-add-swift-support 2.0.2 “AddSwiftSupport” cordova-plugin-badge 0.8.8 “Badge” cordova-plugin-camera 4.1.0 “Camera” cordova-plugin-chooser 1.3.1 “Chooser” cordova-plugin-device 2.0.2 “Device” cordova-plugin-file 7.0.0 “File” cordova-plugin-file-transfer 2.0.0-dev “File Transfer” cordova-plugin-ionic-keyboard 2.2.0 “cordova-plugin-ionic-keyboard” cordova-plugin-ionic-webview 4.2.1 “cordova-plugin-ionic-webview” cordova-plugin-local-notification 0.9.0-beta.2 “LocalNotification” cordova-plugin-media 6.1.0 “Media” cordova-plugin-media-capture 4.0.0 “Capture” cordova-plugin-native-ringtones 0.2.5 “NativeRingtones” cordova-plugin-nativeaudio 3.0.9 “Cordova Native Audio” cordova-plugin-splashscreen 5.0.2 “Splashscreen” cordova-plugin-statusbar 2.4.2 “StatusBar”
Expected Behavior
I expect the local notifications to subscribe to event onTrigger when the notification is triggered whether its in the background or phone is locked . Actual Behavior
The local notification does popup but does not subscribe to the event trigger