I have an existing native android application. I need to implement a local notification on trigger of some event on webview. Here, i am using cordova plugin using jar file. I have performed the following: 1. Copied the java files of plugin(de.appplant.cordova.plugin.localnotification) in src folder 2. copied the cordova.js and localNotification.js in assets folder 3. added plugin in config.xml code snippet in local js file:
window.plugin.notification.local.add({
id: 7, // A unique id of the notifiction
date: now, // This expects a date object
message: "Yup! tHiS iS nOtIfiCaTioN..", // The message that is displayed
title: "Notify user", // The title of the message
repeat: 'hourly', // Either 'secondly', 'minutely', 'hourly', 'daily', 'weekly', 'monthly' or 'yearly'
autoCancel: true, // Setting this flag and the notification is automatically canceled when the user clicks it
ongoing: false, // Prevent clearing of notification (Android only)
});
I am getting error as "Uncaught type error: cannot read property "notification"of undefined at line(Where i had written the code to refer plugin)
I have to integrate a web-application into existing native application using webView and generate local notifications based on some events triggered from web application.
Appreciate help!!!