# Push Notification are not worked when app was closed

**URL:** <https://forum.ionicframework.com/t/push-notification-are-not-worked-when-app-was-closed/86734>\
**Category:** ionic-v3\
**Created:** [April 17, 2017, 2:22am UTC](https://forum.ionicframework.com/t/push-notification-are-not-worked-when-app-was-closed/86734 "2017-04-17T02:22:43Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![vhkhang91](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/vhkhang91/32/108645_2.png) [@vhkhang91](https://forum.ionicframework.com/u/vhkhang91)\
**Post date:** [April 17, 2017, 2:22am UTC](https://forum.ionicframework.com/t/push-notification-are-not-worked-when-app-was-closed/86734/1 "2017-04-17T02:22:43Z")

</div>

Hi all,  
i’m just a newbie on IONIC 2 and wanna deal with Push Notification plugin.  
In case app is opening, everything is worked very fine.  
But about the case we closed the app, IMHO push notification’s subscribers will be dead… So how can I deal with it ?

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [April 17, 2017, 9:33am UTC](https://forum.ionicframework.com/t/push-notification-are-not-worked-when-app-was-closed/86734/2 "2017-04-17T09:33:15Z")

</div>

If your are app is not running, it can not handle anything.  
When your app is later opened, it will be informed about what to handle - so handle it.

---

<div class="post-metadata">

**Author:** ![vhkhang91](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/vhkhang91/32/108645_2.png) [@vhkhang91](https://forum.ionicframework.com/u/vhkhang91)\
**Post date:** [April 18, 2017, 3:17am UTC](https://forum.ionicframework.com/t/push-notification-are-not-worked-when-app-was-closed/86734/3 "2017-04-18T03:17:59Z")

</div>

So is there any way to auto increase the app’s badge when I received Push from server ?

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [April 18, 2017, 10:47am UTC](https://forum.ionicframework.com/t/push-notification-are-not-worked-when-app-was-closed/86734/4 "2017-04-18T10:47:44Z")

</div>

Yes, badge numbers can be changed - increased, decreased or removed. Your push provider should offer some documentation on that.

---

<div class="post-metadata">

**Author:** ![LoLStats](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lolstats/32/103165_2.png) [@LoLStats](https://forum.ionicframework.com/u/LoLStats)\
**Post date:** [April 18, 2017, 10:59am UTC](https://forum.ionicframework.com/t/push-notification-are-not-worked-when-app-was-closed/86734/5 "2017-04-18T10:59:01Z")

</div>

Can you explain which Push Service do you use? OneSignal is the best way to handle Push notifications in my opinion.

---

<div class="post-metadata">

**Author:** ![vinhtai000](https://avatars.discourse-cdn.com/v4/letter/v/5f8ce5/32.png) [@vinhtai000](https://forum.ionicframework.com/u/vinhtai000)\
**Post date:** [April 19, 2017, 2:13am UTC](https://forum.ionicframework.com/t/push-notification-are-not-worked-when-app-was-closed/86734/6 "2017-04-19T02:13:28Z")

</div>

We used FCM and phonegap-plugin-push to work with notification.

When my app is running in background or be closed, It’s automatically insert message to system tray (notification bar), and badge numbers doesn’t change with number was sent from server.

Do you have any plugins else to deal with it ?

---

<div class="post-metadata">

**Author:** ![LoLStats](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/lolstats/32/103165_2.png) [@LoLStats](https://forum.ionicframework.com/u/LoLStats)\
**Post date:** [April 19, 2017, 5:22am UTC](https://forum.ionicframework.com/t/push-notification-are-not-worked-when-app-was-closed/86734/7 "2017-04-19T05:22:15Z")

</div>

Maybe this tutorial will help you out: [https://ampersandacademy.com/tutorials/ionic-framework-version-2/push-notification-using-google-firebase](https://ampersandacademy.com/tutorials/ionic-framework-version-2/push-notification-using-google-firebase)

```
      } else {
    //if user NOT using app and push notification comes
    //TODO: Your logic on click of push notification directly
    //self.nav.push(DetailsPage, {message: data.message});
    console.log("Push notification clicked");
  }

```

It explains exactly what you need 🙂

---

<div class="post-metadata">

**Author:** ![vahidvdn](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/vahidvdn/32/94016_2.png) [@vahidvdn](https://forum.ionicframework.com/u/vahidvdn)\
**Post date:** [June 14, 2017, 4:05pm UTC](https://forum.ionicframework.com/t/push-notification-are-not-worked-when-app-was-closed/86734/8 "2017-06-14T16:05:33Z")

</div>

Is there any solution? My app works fine and I get notification when the app is opened or working in background, but when I close it and send push notification from ionic push service, I can’t receive it.

---

<div class="post-metadata">

**Author:** ![NurGuz](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nurguz/32/111671_2.png) [@NurGuz](https://forum.ionicframework.com/u/NurGuz)\
**Post date:** [September 25, 2017, 4:47pm UTC](https://forum.ionicframework.com/t/push-notification-are-not-worked-when-app-was-closed/86734/9 "2017-09-25T16:47:27Z")

</div>

I’m using OneSignal and can’t show notification if the app are closed. Any solution for this?
