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.

Local Notification is not formed in ios11

See original GitHub issue

Local notification is not formed in ios 11 with 0.8.5 and 0.9.0-beta.3 versions . Application is able to receive the FCM(Firebase cloud messaging) notification data and when the application tries to create local notification ,its not formed even in the FCM trigger block as well as outside its scope.

Environment

  • Plugin version: 0.9.0-beta.3
  • Platform: ios
  • OS version: 11
  • Device manufacturer / model: apple
  • Cordova version (cordova -v): 8.0.0
  • Cordova platform version (cordova platform ls): 8.0.0
  • Plugin config “@ionic-native/local-notifications”: “^4.11.0”,
  • Ionic Version (if using Ionic) 3.20.0

Expected Behavior

Its expected that whenever the application tries to schedule the local notification ,it should appear on user’s screen.

Actual Behavior

Local notification is never formed.

Steps to Reproduce

Reproduce this issue; include code to reproduce, if relevant

  1. Get the FCM token for the app
  2. Write the local notification code inside the onNotification block
  3. create the local notification on the main page even.

Context

Was trying to use the firebase cloud messaging service in ios and fcm is working fine but whenever the application tried to show user a notification ,its unable to do the same.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
soniabehalcommented, Aug 21, 2018

@Tawpie, The code i am using to schedule the local notification is as below

this.localNotifications.schedule({
              id: ++this.id,
              text: data.extra_information,
              title: data.title
            });

and the above code is written under

this.fcm.onNotification().subscribe(data => {}) // FCM Block

There is one another issue, the local notification calls this FCM block rather then displaying to user

0reactions
JuanCarlosSCcommented, Jan 31, 2019

It happens to me exactly the same when I receive a notification from FCM and I’m in the foreground the method catches

vm.fcm.onNotification().subscribe(data => {
        if(data.wasTapped){
          console.log("Received in background");
        } else {
          console.log("Received in foreground");
          console.log("Received in foreground",JSON.stringify(data))
          vm.localNotifications.schedule({
            id: 1,
            text: 'Single ILocalNotification 1',
            sound: "default",
            foreground: true,
            data: { secret: 1 }
          });
        };
      });

That is when we call the local notification, but there is no sample, in addition to the local notification, we call the complete function of FCM and create an infinite loop, when we leave the application, we ask them to respond.

Read more comments on GitHub >

github_iconTop Results From Across the Web

An iOS 11 Local Notification Tutorial - Techotopia
Local notifications can be triggered based on elapsed time interval, a specific date and time or a location change.
Read more >
Local Notification not working in iOS 10.3.1 - Stack Overflow
Im using region monitoring to get location changes and create notification request if needed.
Read more >
UILocalNotification | Apple Developer Documentation
The operating system is responsible for delivering local notifications at their scheduled times; the app does not have to be running for this...
Read more >
Push Notifications and Local Notifications - Tutorial
By using notifications, you can notify the user about important events even when the app is not running. In this tutorial you will...
Read more >
Push Notifications and Local Notifications (Xcode 9, iOS 11)
By using notifications, you can notify the user about important events even when the app is not running. In this tutorial you will...
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