OneSignal Push Notification Background


I trying receive pushnotifications when my app is close. It is Possible?


 this._OneSignal.startInit("xxx", "xxxx");

      this._OneSignal.handleNotificationReceived().subscribe((data) => {
        // if (data.payload.additionalData)
        // {
        // }

      this._OneSignal.handleNotificationOpened().subscribe((dataOpen) => {        

        let dadosDetail = this.schedlueProvider.GetSchedlueByID(30).subscribe(
          data => {                      

Your app should be able to receive notifications if it is in the background, but what it can’t do is take action on them until the user opens the app by clicking on the notification.

Can you clarify further what is happening and what you’re trying. The code sample helps, but we also need to know what your goal is and what your current behavior is

I need receive notification when my app is closed.
-User 1 save register
-User 2 need receive notification of User 1(App not need is running)

*My App is able to receive in background

Yes this is possible.

Hi Sujan12

Can you show me any example?


Every app that uses push notifications does this. Close the app, push to the app, the push notification is received by the OS and shown in the notification center. Done.

I´m load app in device through command

ionic run android

Is necessary load one more command?

If I closed the app and send notification, don’t show. Needed open the app

I got this issue also, do you have idea how to fix it?