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.

iOS : Silent notifications not silent ?

See original GitHub issue

Your Environment

  • Plugin version: 0.9.0-beta.1
  • Platform: iOS
  • OS version: 11.1
  • Device manufacturer / model: iPhone 6s (iPhone 8,1)
  • Cordova version : 7.1.0
  • Cordova platform version : ios 4.5.0
  • Plugin config : default

Expected Behavior

I am trying to trigger (and update) a notification silently on iOS, when the app is on foreground. From my understanding, a silent notification should not be displayed on the screen when it is triggered (or emit any sound or vibration). It should only be visible when opening the notification tray.

Actual Behavior

Whatever combination of options I use, the notification either displays on the top of the screen, or seems to be not triggered (no notification in the notification tray), without any errors. I also tried to play with the foreground option to false without success.

Steps to Reproduce

I use the following code :

` cordova.plugins.notification.local.schedule( { id : 1, title: “Hi !”, text: ‘That was pretty easy…’, sound: false, vibrate: false, silent: true });

`

Context

I have no idea if i use the “silent” option correctly (btw I could really not find any documentation about it). Maybe the silent option is not even appropriate here. I tried other options like putting foreground to false, but nothing worked for me.

My goal is to emit (and update) a notification silently when the app is on foreground, without the user noticing it. When the user put the app to the background, they can see the state in which they left the app by looking at the notification.

Thanks a lot if you could provide any hint here 😃 And thanks to @katzer and all the people developing this plugin, which is working great (despite this small issue) !

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
katzercommented, Feb 8, 2018

The behaviour of a silence notification depends on the native system. For iOS it means that if the phone is running in foreground and receives a system call about a triggered notification, the plugin will just fire the trigger event while no banner will pop up and no notification will be added to the notification center.

1reaction
GeneralUSAcommented, Feb 6, 2018

I found my resolve at the following issues: https://github.com/katzer/cordova-plugin-local-notifications/issues/1412 https://github.com/katzer/cordova-plugin-local-notifications/issues/1413 https://github.com/katzer/cordova-plugin-local-notifications/issues/1493

My end code, which I am still tweaking, works with this test base code below, and won’t fire until the app is closed (a good thing):

cordova.plugins.notification.local.schedule({ title: ’ title ', text: 'text\‘s words’, foreground: false, silent: true, trigger: { every: 1, unit: ‘minute’ } , // for testing, eventually every week; not sure how to let them select the day });

trigger needs v0.9-beta

Read more comments on GitHub >

github_iconTop Results From Across the Web

Silent Push Notifications doesn't work properly on iOS 14
Experiencing same problem, silent notifications are not received and if app is put to background and then brought to foreground it starts to...
Read more >
iOS Silent APNS push notification does not go thru
I am experiencing the Apns silent background notification sent with pushtype="background", priority="5", contentavailable=true never reaches the ...
Read more >
Silent Push Notifications for iOS - Braze
Use silent remote notifications to trigger background work. Silent remote notifications can wake your app from a “Suspended” or “Not Running” state to...
Read more >
What Are Silent Notifications? - iZooto
Users can opt to receive silent push notifications on iOS also by going to the Settings > Notifications> and by clicking on the...
Read more >
[firebase_messaging] Silent notifications not handled on iOS
When a silent notification is sent through firebase, the android app can handle the notification both in the foreground and background. Silent ......
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