Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local Notifications Trigger events Not working on Android 12 #1989

Open
bevinGithub opened this issue Oct 13, 2022 · 1 comment
Open

Local Notifications Trigger events Not working on Android 12 #1989

bevinGithub opened this issue Oct 13, 2022 · 1 comment

Comments

@bevinGithub
Copy link

WARNING: IF YOU IGNORE THIS TEMPLATE, WE'LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!

Provide a general summary of the issue.
I have Local Notifications 12 plugin and l want to subscribe to events when the notification triggers. I want to subscribe to event Trigger but the plugin is not subscribing to any events.

Your Environment

I have the following environment setup.
Ionic:

Ionic CLI : 6.20.1 (C:\Users\Tigere Bervin\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/angular 6.2.8
@angular-devkit/build-angular : 14.2.3
@angular-devkit/schematics : 14.2.3
@angular/cli : 14.2.3
@ionic/angular-toolkit : 6.1.0

Cordova:

Cordova CLI : 11.0.0
Cordova Platforms : android 10.1.2
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 7 other plugins)

Utility:

cordova-res : 0.15.4
native-run : 1.7.1

System:

NodeJS : v14.15.4 (C:\Program Files\nodejs\node.exe)
npm : 6.14.10
OS : Windows 10

C:\ionicAndroid12\prosperclocknew>cordova plugin list
cordova-plugin-androidx-adapter 1.1.3 "cordova-plugin-androidx-adapter"
cordova-plugin-androidx 3.0.0 "cordova-plugin-androidx"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 5.0.0 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"

Expected Behavior

When the notification triggers we should be able to subscribe to events like Trigger or onCLick

Actual Behavior

When the notification triggers nothing is subscribed to meaning no events are subscribe to plugin ignores the subscribe section

Steps to Reproduce

Reproduce this issue; include code to reproduce, if relevant

Local Notifications crashes the app, l have troubleshoot the issue and the problem is on the trigger any configurations the app is crashing. The settings below works on platform 10.0.0 works very well but we cannot publish with Platform Level 10.0.0

this.localNotifications.schedule({
id: 1,
text: 'Single LocalNotification',
trigger: {every: { weekday: 1, hour: 11, minute: 31 }, count: 1}
});

this.localNotifications.schedule({
id: 1,
text: 'Single LocalNotification',
trigger: {at: new Date(new Date().getTime() + 3600)},
});

I have tested the plugin katzer /
cordova-plugin-local-notifications it doesnt work on the events onTrigger

onDeviceReady() {
this.localNotifications.on('trigger').subscribe((test: any) => {
console.log('Trigger' + JSON.stringify(test));
});
}

Its not logging the subscription out as l need to process data from the data: { test: 'Test Data }.

Context

What were you trying to do?

Play custom audio files when the alarms is triggered onTrigger event

@bevinGithub
Copy link
Author

Anyone has managed to resolve the Local Notifications subscription event onTrigger on android 12
onDeviceReady() {
this.localNotifications.on('trigger').subscribe((test: any) => {
console.log('Trigger' + JSON.stringify(test));
});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant