Notifications not working, but forked Version working
See original GitHub issueI am trying to create an app which uses local notifications with Phonegap Build. I’ve tried numerous ways to get your plugin to work, but it sadly never worked. Now, I’ve found this https://www.npmjs.com/package/cordova-plugin-local-notifications-npm on npm, which has been forked from you and it works perfectly fine. I am a little worried though, because my app now asks for the permission to write on the sd-card, which it has never done before and in general I’d be happier if i could use your original repo here.
My Environment
- Plugin version: I tried everything from 0.6 to 0.9
- Platform: Android
- OS version: 8.0.0
- Device manufacturer / model: Xperia G3121
- Cordova version (
cordova -v
): IDK (I am using Phonegap Build cli-6.5.0) - Cordova platform version (
cordova platform ls
): IDK
Expected Behavior
I tried a very simple
cordova.plugins.notification.local.schedule({ title: 'Hello World', trigger: { in: 5, unit: 'second' } });
Actual Behavior
It doesnt trigger at all if I use your Plugin. Above version 0.6.0, Phonegap Build Cloud Service won’t even let me install the Plugin, even if i set SDK Version to 27.
Steps to Reproduce
This Version does NOT work:
config.xml :
<widget id="***" version="***">
<name>***</name>
<description>***</description>
<author>***</author>
`<plugin name="cordova-plugin-local-notification" spec="https://github.com/katzer/cordova-plugin-local-notifications#0.6.0"/>`
</widget>
This one DOES work:
config.xml :
<widget id="***" version="***">
<name>***</name>
<description>***</description>
<author>***</author>
`<plugin name="cordova-plugin-local-notifications-npm"/>`
</widget>
index.html:
<html>
<body>
<script src="cordova.js"></script>
<script>
setTimeout(function(){ cordova.plugins.notification.local.schedule({ title: 'Hello World', trigger: { in: 5, unit: 'second' } }); },5000) ;
</script>
</body>
</html>
Context
As mentioned above, i was just trying to get the plugin running.
Debug logs
I am currently not able to debug on my Phone, as i have no USB-Cable available for remote debugging, if you have any other method of debugging I’d be very pleased to hear of it.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (1 by maintainers)
Top GitHub Comments
@dragonStandard123 Get the code from this fork to use local notifications on Android Oreo
@Steffaan I’m little bit worried about, that you talk about “Push Notifications”. “Push Notifications” are Network based Notifications and for Google it’s called “Firebase Cloud Messaging” and has nothing to do with Local Notifications. Your change for the permission fix: https://github.com/Steffaan/cordova-plugin-local-notifications/commit/b7c7e75548d6f379cdb79c435e99bbd6547aa9c6 didn’t change anything, because
getNotMgr().hasPermission()
already has calledgetNotCompMgr().areNotificationsEnabled()
see https://github.com/Steffaan/cordova-plugin-local-notifications/blob/b7c7e75548d6f379cdb79c435e99bbd6547aa9c6/src/android/notification/Manager.java#L92