question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

local notification doesn't work on iOS !

See original GitHub issue

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);
          });
.... 

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:22

github_iconTop GitHub Comments

2reactions
brettyboocommented, Jul 7, 2016

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" }
    });
});
1reaction
brettkokocommented, Oct 6, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

Local Notification not working in Background Mode
When app is in background, notifications wont show. After investigating this issue i found that they work fine when app is running in...
Read more >
iOS 10 Local Notifications not showing - Stack Overflow
1 Answer 1 · Make sure you have the permission. If not, use UNUserNotificationCenter.current().requestAuthorization to get that. Or follow the answer below if ......
Read more >
Notifications not working in iOS 16? 9 Ways to fix it! - iGeeksBlog
To fix Notifications not working on iPhone running iOS 16, 1. Turn off Focus on iPhone, 2. Add exceptions to Focus, 3.
Read more >
Local Notification doesn't work on iOS 12.4.6 and iOS 13.2.4
Hi Allan, I find the issue. This notification is only work if the app ISN'T in the foreground (in the background) or iPhone...
Read more >
Flutter Local Notification Why Sound Doesn't Work Android ...
Flutter background notification sound Flutter local notification sound not working Firebase push notification iOS no sound The backend app ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found