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.

Unable to trigger Local Notification IOS 11

See original GitHub issue

WARNING: IF YOU IGNORE THIS TEMPLATE, WE’LL IGNORE YOUR ISSUE. YOU MUST FILL THIS IN!

Provide a general summary of the issue.

Your Environment

  • Plugin version: 0.8.4 (unable to run 0.9 - Build Failed)
  • Platform: Cordova / AngularJS
  • OS version: IOS 11
  • Device manufacturer / model: All IOS 11 Devices
  • Cordova version (cordova -v): 7.0.0
  • Cordova platform version (cordova platform ls): android 6.1.2 / ios 4.3.1,
  • Plugin config: no specific config

Expected Behavior

I should be able to display local notifications on IOS 11 (I guess)

Actual Behavior

The notifications are not displayed even if they are scheduled on IOS 11 (Works on IOS 9)

Context

I use XCode in my Cordova Project to build and publish my app. Android version works but i have errors to run local notification with IOS 11 ( Xcode emulator or real Device "Iphone5S )

Steps to Reproduce

  1. XCode Compilation is ok
  2. Launch Appli is ok
  3. When launching Notification, Xcode Launch exceptions (Following)

Debug logs

Xcode Console gave me these indications:

  • cordova.plugins.notification.local.hasPermission is true after popup permission agreement
  • but firing notification i have Main Thread Checker: UI API called on a background thread: -[UIApplication cancelLocalNotificationand APPLocalNotification cancelForerunnerLocalNotification

Here is my notifications tests:

cordova.plugins.notification.local.registerPermission(function (granted) {
      console.log('Permission has been granted: ' + granted);
      if(granted){
            cordova.plugins.notification.local.schedule({
                    id: '5465512318798',
                    title: 'TEST',
                    text: 'a test',
                    badge: 0
            });
     }
});

And, on IOS my schedule and trigger tests:

cordova.plugins.notification.local.on("schedule", function(notification) {
                        alert("scheduled: " + notification.id);
                    });
cordova.plugins.notification.local.on("trigger", function(notification) {
                        alert("triggered: " + notification.id);
                    });
cordova.plugins.notification.local.on("click", function(notification) {
                        alert("clicked: " + notification.id);
                    });

On android, each .on is triggered; on IOS i only have the schedule alert

  • ios XCode logs
  • Android: $ adb logcat

Thanks in advance for you help.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
BeMontellicommented, Feb 9, 2018

The error i got in Xcode are always the same:

Main Thread Checker: UI API called on a background thread: -[UIApplication cancelAllLocalNotifications]
4                   0x0000000100dcd724 -[APPLocalNotification cancelAllLocalNotifications] + 76
5                   0x0000000100dcaee0 __34-[APPLocalNotification cancelAll:]_block_invoke + 52
-[UIApplication cancelAllLocalNotifications]
4                   0x0000000100dcd724 -[APPLocalNotification cancelAllLocalNotific5                     0x0000000100dcaee0 __34-[APPLocalNotification cancelAll:]_block_invoke + 52
4                   0x0000000100dcd76c -[APPLocalNotification cancelAllLocalNotifications] + 148
5                   0x0000000100dcaee0 __34-[APPLocalNotification cancelAll:]_block_invoke +4                      0x0000000100dcd76c -[APPLocalNotification cancelAllLocal5                      0x0000000100dcaee0 __34-[APPLocalNotification cancelAll:]_block_invoke + 52
7                   0x0000000100dcaf0c __34-[APPLocalNotification cancelAll:]_block_invoke + 96
7                   0x0000000100dcaf0c __34-[APPLocalNotification cancelAll:]_block_invoke + 92018-02-09 10:05:49.471044+0100 [2162:1354783] cancelAll
6                   0x0000000100dcd8ec -[APPLocalNotification cancelForerunnerLocalNotification:] + 196
6                   0x0000000100dcd8ec -[APPLocalNotification cancelForerunnerLocalNotification:] + 196
2018-02-09 10:05:53.438402+0100 [2162:1354783] cancelAll
0reactions
katzercommented, Feb 14, 2018

Please reopen in case of need. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Swift - Local Notification doesn't get triggered - Stack Overflow
You were missing the handling, when the app is in foreground, you were not specifying how the notifications would look like or be...
Read more >
Notification triggered from iPhone to Watch - Apple Developer
Hi,. I have a test app for local iOS notifications but I want them to be displayed on the Apple Watch. Is there...
Read more >
Scheduling local notifications - a free Hacking with iOS
The trigger determines when the notification should be shown, and can be a number of seconds from now, a date and time in...
Read more >
Notifications Not Shown - Mobile Push
iOS Mobile App Notifications Not Showing ... The most common reason is an outdated version of the OneSignal SDK in the app. Make...
Read more >
Local Notifications in iOS. Local Notifications in iOS - Medium
Apple suggests completing this before app launch using application:didFinishLaunchingWithOptions: . Whether you handle this in the AppDelegate ...
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