cordova-plugin-local-notifications: Local notifications problem with Angularjs

I have a problem with Android mobile notifications. I am using Angularjs and ionic framework. I want to work with local notifications and I use this plugin. https://github.com/katzer/cordova-plugin-local-notifications

<addr> var app = angular.module('Forex', ['ionic', 'ngCordova']) app.controller("MainCtrl", function($scope,$http,$interval, $ionicPlatform, $cordovaLocalNotification) {

$ionicPlatform.ready(function () { $scope.scheduleSingleNotification = function () { $cordovaLocalNotification.schedule({ id: 1, text: ‘test’ }) .then(function (result) { console.log(result); }); }

});

But if I press the button in my html page ng-click=“notification()”

I get an error ReferenceError: $cordova is not defined

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 15 (1 by maintainers)

Most upvoted comments

@PatrickDinh I get this error Uncaught TypeError: Cannot read property ‘notification’ of undefined

Why is every documentation about this plugin so different. Every website and person says something else.