0

I am using push api from OneSignal.com to send notifications. It's working perfectly but I want to receive notifications only if app is Active. If app is closed or not active then Onsignal notifications should be stopped.

Is this possible with this service?

I'll really appreciate for any contribution.

Thanks

user2899728
  • 2,099
  • 4
  • 16
  • 28
  • Check `[UIApplication sharedApplication].applicationState` for `UIApplicationStateActive` http://stackoverflow.com/a/8292048/4488635 – markedwardmurray Jul 24 '16 at 08:52
  • I am using cordova. How can I use above code? I can write only javascript. – user2899728 Jul 24 '16 at 11:49
  • Push notifications are designed to reach users when they are not activity using your app. In your case it sounds like you are looking for local notifications. – jkasten Jul 28 '16 at 02:20

1 Answers1

0

You does not send push notification on active user however you have send notification using creating segment with adding filter last session time.

Hitesh Patel
  • 59
  • 1
  • 6