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 : notifications works only after installing app

See original GitHub issue

On iOS, I can make work the notifications (cloud messaging) only after the app installation Also it only works for foreground notifications (background notifs are all received at resuming app)

But if I kill the app, or if the app close by itself (after long pausing), or after the next tns run ios, then the notifications stop to work at all :

  • onMessageReceivedCallback (inside init option) is ever no more called
  • firebase.addOnMessageReceivedCallback no more called too Until the next installation…

I use firebase console to send notifications, and whether I use single device (FCM) or user segment as target, the result is the same : it works only after the app installation

Here is version I use :

  • iPhone 6 (version 10.2 (14C92)
  • nativescript plugin firebase : 3.11.4
  • tns info :
    • angular : 2.4.3
    • nativescript : 2.5.4 │ Up to date
    • tns-core-modules : 2.5.2 │ Up to date
    • tns-android : 2.5.0 │ Up to date
    • tns-ios : 2.5.0 │ Up to date

On android, it works great

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:12

github_iconTop GitHub Comments

3reactions
rgchuacommented, May 25, 2017

Had this same issue for several days on iOS. (Tested on both iOS 9 and iOS 10), {N} 3

Running firebase.init before the application has launched seems to be the cause of the issue. This can be remedied by running firebase.init in your first view-model.

Hope this helps.

0reactions
arxpoeticacommented, Feb 21, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

Notifications only show when I launch the app
I'm using iPhone 11 Pro Max and only recently I've experience this issue where none of my notification is alerting me unless I...
Read more >
Push notification works only when app launched with Xcode
Everything works perfectly, only when I launch my application without the help of Xcode, I no longer receive the notifications, the  ...
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 >
Top 8 Tips to Fix iPhone Notifications Not Working on iOS 16/15
Press and hold the icon of the app you're not receiving notification from until all of the icons on the screen start to...
Read more >
Notifications Not Shown - Mobile Push
Step 2: Settings --> Apps or Notification Manager --> Advanced or Notify for your app --> Ignore Battery Optimizations, select the app and...
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