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.

Asks for permission, never shows example notification

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.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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
bgandocommented, Oct 19, 2017

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

3reactions
katzercommented, Oct 30, 2017

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Asking Permission to Use Notifications - Apple Developer
Asking Permission to Use Notifications. Request permission to display alerts, play sounds, or badge the app's icon in response to a notification.
Read more >
Ask permission for push notification - android - Stack Overflow
Actually the push notification permission lie in the normal category permission like Internet permission, not in dangerous category permission.
Read more >
Notification runtime permission - Android Developers
When you request notification permissions within your app, do so in the correct context, so that it's explicitly clear what the notifications are...
Read more >
How to Prompt for Push Permissions with an In-App Message
In-App Messages that have a Push Permission Prompt button will not be shown to users who have already allowed notifications. If users have...
Read more >
Change app permissions on your Android phone
You can allow some apps to use various features on your phone, such as your camera or contacts list. An app will send...
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