cordova-plugin-local-notifications
cordova-plugin-local-notifications copied to clipboard
Local notifications does not subscribe to events when the notification is triggered in the background or when device is Locked on IOS Device 16.1.2 OS
WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!
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 @angular-devkit/schematics : 12.1.4 @angular/cli : 12.1.4 @ionic/angular-toolkit : 4.0.0
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 on trigger which l have functions to play custom audios files
Steps to Reproduce
Reproduce this issue; include code to reproduce, if relevant
Setup a local notification as normal and lock the device or put the app in the background
Context
Set an alarm and play custom audios or device ringing tones when the event onTrigger is subscribed to.
Debug logs
Include iOS / Android logs
- ios XCode logs
- Android: $ adb logcat
Anyone out there having the same issue as me on IOS
Hey @bevinGithub I am facing the same issue. Did you find any workaround? I tried Capacitor local-notifications, same issue there.