0

I’m using local notifications native plugin on my ionic 4 project (latest version), but when I click on notification and my app is closed the click event is not triggered. It works when app is in background or foreground in ios device. I use local notifications inside a provider and my on click code is inside its constructor but when app is closed it's not working. I’ve tried to write code inside platform ready in app/app.component.ts but this approach does not work. This is my code:

this.platform.ready().then((readySource) => {
           this.localNotifications.on('click').subscribe(noti)=> { 
                                           alert("ok");
                });
        });

3
  • try to add platform.ready function in home page (rootPage) Commented Mar 29, 2019 at 2:31
  • but not working Commented Mar 29, 2019 at 6:09
  • @AnandhSp I have the same issue. I have tried to call it inside platform ready in home.ts constructor. But still no success. I have IOS 12 in my iPad device. This woks pefectly when Ionic app is running in background. Is it something related to event lifecycle. blog.ionicframework.com/navigating-lifecycle-events Commented Mar 29, 2019 at 11:36

1 Answer 1

0

I have the same issue. I have tried to call it inside platform ready in home.ts constructor. But still no success. I have IOS 12 in my iPad device. This works perfectly when Ionic app is running in background. But it does not work when App is killed and not opened.

Is it something related to event life-cycle? https://blog.ionicframework.com/navigating-lifecycle-events/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.