Cordova-plugin-local-notifications: Asks for permission, never shows example notification

Created on 17 Oct 2017  路  10Comments  路  Source: katzer/cordova-plugin-local-notifications

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.0.0
  • Platform: ios
  • OS version: 11.0
  • Device manufacturer / model: simulator, various (tried: 5S, 7, X, SE)
  • Cordova version (cordova -v): 7.1.0
  • Cordova platform version (cordova platform ls):
    Installed platforms:
    ios 4.5.1
    windows 5.0.0
  • Plugin config unsure
  • Ionic Version (if using Ionic) N/A

Expected Behavior

A notification to pop up

Actual Behavior

It asks for permissions but never shows a notification. I get an error, see below.

Steps to Reproduce

_Reproduce this issue; include code to reproduce, if relevant_

  1. trigger this code to execute:
cordova.plugins.notification.local.schedule({
      title: "New Message",
      message: "Hi, are you ready? We are waiting."
    });
  1. Accept permissions to show notification
  2. trigger the code above again, nothing happens

Context

I am trying to get an example notification to run for the first time.

Debug logs

Main Thread Checker: UI API called on a background thread: -[UIApplication currentUserNotificationSettings]
PID: 38687, TID: 1053046, Thread name: (none), Queue name: com.apple.root.default-qos, QoS: 21
Backtrace:
4   app name                      0x000000010b2cb858 -[UIApplication(APPLocalNotification) registerPermissionToScheduleLocalNotifications] + 168
5   app name                     0x000000010b2c9631 __43-[APPLocalNotification registerPermission:]_block_invoke + 65
6   libdispatch.dylib                   0x00000001129293f7 _dispatch_call_block_and_release + 12
7   libdispatch.dylib                   0x000000011292a43c _dispatch_client_callout + 8
8   libdispatch.dylib                   0x000000011292f352 _dispatch_queue_override_invoke + 1458
9   libdispatch.dylib                   0x00000001129361f9 _dispatch_root_queue_drain + 772
10  libdispatch.dylib                   0x0000000112935e97 _dispatch_worker_thread3 + 132
11  libsystem_pthread.dylib             0x0000000112de85a2 _pthread_wqthread + 1299
12  libsystem_pthread.dylib             0x0000000112de807d start_wqthread + 13
  • ios XCode logs
  • Android: $ adb logcat

Most helpful comment

I fixed my problem by making sure I was installing the latest release of the plugin, not 0.8.1:

cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#0.8.5

Also, this example branch is in a working state:
https://github.com/katzer/cordova-plugin-local-notifications/tree/example-x

All 10 comments

same here, any info/news?

I fixed my problem by making sure I was installing the latest release of the plugin, not 0.8.1:

cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#0.8.5

Also, this example branch is in a working state:
https://github.com/katzer/cordova-plugin-local-notifications/tree/example-x

cordova plugin add https://github.com/katzer/cordova-plugin-local-notifications#0.8.5

Was the trick, thank you

I've got the same issue but I'm using an Ionic3 app deployed to iOS11.
Updated to 0.8.5 and get the same result.
I can see it scheduled but never triggered. No errors from the plugin.

@kyle9292 did you figure this out? Having the same issue.

@wootwoot1234 No I haven't. Sorry. Just kind of waiting for the plugin to be updated.

Please use the latest code - you can use the master branch now. That issue with iOS11 and UI thread has been solved already.

Thanks @katzer! I appreciate all your hard work to get out this fix.

@katzer thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

daniele-sartiano picture daniele-sartiano  路  4Comments

AbayIbrayev picture AbayIbrayev  路  4Comments

ThorvaldAagaard picture ThorvaldAagaard  路  3Comments

jomarocas picture jomarocas  路  3Comments

ghost picture ghost  路  5Comments