hy all, im really new to this programming thing, and need some help, this is my first post, sorry if mess
i have a problem with using cordova local notification https://github.com/katzer/cordova-plugin-local-notifications for my app, i’m already surfing the internet and try all tutorial here, but no result. actually i have made it work for once by tutorial using blank project but when it aplied to my app, no result. oh , i build this for android, so i guess no permission is needed and i make it with ionic framework
this the list i already do
-update ionic
-update cordova
-re insert the plugin
-insert the code into the ready flatform
-using $scope.on
-remake app
-and many more
the case is when i click button, alert is showed but not read the $cordovaLocalNotification function
somewhow it show “plugin” is not definied
somewhow it show "notification"is not definied
i know plugin dont work with browser, so i tried it in device (not simulator) and no result , just alert
i use some plugin, in case i it have some merge problem
-datepicker
-0atimepicker
-sqlite database
this is my code for now,
my index.html
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic-datepicker/dist/ionic-datepicker.bundle.min.js"></script>
<script src="lib/ionic-timepicker/dist/ionic-timepicker.bundle.min.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="js/ng-cordova.min.js"</script>
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="cordova.js"></script>
this is my js
jadwal.controller("HariController", function($rootScope, $scope, $cordovaLocalNotification, $ionicPlatform, $ionicPopup, $cordovaSQLite, $stateParams, $ionicModal, $state, $window, $timeout, $cordovaNativeAudio) {
$ionicPlatform.ready(function() {
ambilData();
if (window.cordova) {
document.addEventListener(“deviceready”, function() {
window.plugin.notification.local.onadd = $cordovaLocalNotification.add;
window.plugin.notification.local.onclick = app.onReminderClick;
window.plugin.notification.local.oncancel = app.onReminderCancel;
window.plugin.notification.local.ontrigger = app.onReminderTrigger;
}, false);
}
// disableback();
});
$scope.addNotification = function(tit, msg) {
$cordovaLocalNotification.add({
id: ‘MYLN’,
title: tit,
message: msg
});
}
i know missing something, but i don’t know what it is. this problem make me dizzy for couple of day. i hope some
master can solve this problem. sorry for bad english , help me please :(cry: