cordova-plugin-local-notifications: local notification doesn't work on iOS !

Hello,

I’m trying local notification on a new blank app. But I can’t have the notifications triggered on iOS (I have an iPhone 5 with iOS 9.3). Everything’s working on Android but not on iOS. First I thought it was a notification permission problem, so I started to implement the hasPermission function, but it didn’t work better. So I tried to add the notification registering directly in the Objective-C code. I got the message to activate notifications for this app, but then, the notifications still doesn’t work when I click on my app’s buttons.

Just to summarize I simplified the code and the following one works fine on Android but on iOS, it only displays the “test permission” alert :

app.controller('NotificationController', function($scope, $cordovaLocalNotification, $ionicPlatform) {
    $ionicPlatform.ready(function () {
          alert('test permissions !');
          window.plugin.notification.local.hasPermission(function (granted) {
              alert('Permission has been granted: ' + granted);
          });
.... 

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 22

Most upvoted comments

This code works for me with iPhone 5S with iOS 9.3.2 and Cordova 6.2

cordova.plugins.notification.local.registerPermission(function(str) {
    console.log('Push Permissions:'+str);
    cordova.plugins.notification.local.schedule({
        id: 10,
        title: "yo test in 15 minutes!",
        text: "test test test",
        badge: 1, 
        icon: 'res://drawable-mdpi-v4/icon.png',
        smallIcon:'res://drawable-ldpi-v4/icon.png', 
        data: { yo_payload:"yo data" }
    });
});