Closed clonez closed 10 years ago
Where does the error occurs, file & line? Sounds like JavaScript. May you could post your code?
its the example of your code which fires every 60 secs from now:
var now = new Date().getTime(), _60_seconds_from_now = new Date(now + 60*1000);
window.plugin.notification.local.add({ id: 1, // is converted to a string title: 'Reminder', message: 'Dont forget to buy some flowers.', repeat: 'weekly', date: _60_seconds_from_now, foreground: 'foreground', background: 'background' });
function foreground (id) { console.log('I WAS RUNNING ID='+id) }
function background (id) { console.log('I WAS IN THE BACKGROUND ID='+id) }
below upon the error mention from the adt's LogCat:
are you calling the code after the deviceready
event?
inside the onDeviceReady event on index.js. Actually tried after deviceready event too, same error mention the above attached
Hi katzer any solution for this?
To me it looks like the plugin isn't installed properly. Have you installed the plugin through cordova plugin add ...
?
In your cordova_plugins.js
the plugin should be listed like this:
cordova.define('cordova/plugin_list', function(require, exports, module) {
module.exports = [
{
"file": "plugins/de.appplant.cordova.plugin.local-notification/www/local-notification.js",
"id": "de.appplant.cordova.plugin.local-notification.LocalNotification",
"clobbers": [
"plugin.notification.local"
]
},
...
]
the plugin has been already added before I try out the example (screenshot)
I've ammend the cordova_plugins.js as the above follows, however the issue same appears
theres new error: "Unable to open asset URL"
Strange, does the local_notification.js file exist? Have you tried to reinstall the plugin?
tried reinstall, local-notification.js file does exist.
thats the plugin folder. But the log says, that the js file inside your project cannout be found:
www/plugins/de.appplant.cordova.plugin.local-notification/www/local-notification.js
Have you added android as a platform through the CLI as well?
cordova platform add android
I did add Android platform before started, its "android 3.3.0-rc1"
Dont whats the reason for that issue. Are you sure that the plugin source was copied into the project under /src and /assets?
Hi katzer,
am I missing out something else, did follow the examples and cordova added the plugins. But theres no log from the notification plugin. It shows error on "Uncaught TypeError: Cannot read property 'notification' of undefined"