0

We are asked to implement a feature to listen the notification and decide if it should appear or NOT. Even before they appear on the screen ( NSNotificationCenter or Alert/Banner on Top). We have to set a silent time for users and check if the notification is broadcasted from server the iOS device will not display it if the notification is fired during that silent time.

Taimur Ajmal
  • 2,778
  • 6
  • 39
  • 57
  • Check out http://stackoverflow.com/questions/30852870/displaying-a-stock-ios-notification-banner-when-your-app-is-open-and-in-the-fore – Yakiv Kovalskyi Feb 23 '17 at 12:13

2 Answers2

0

You can trigger a silent notification by configuring your payload as below.

1.The payload’s aps dictionary must include the content-available key with a value of 1.

2.The payload’s aps dictionary must not contain the alert, sound, or badge keys.

On arrival of the silent push you can check your conditions and trigger a local notification.

May this help you..

Dinesh
  • 41
  • 1
  • 6
0

You require that Notification already fired from Server,but based on condition you need to stop displaying that.

Apple doesn't support such feature.

This is possible in Android. Here, APNS Server handles all things related to Push Notification.

Dimple Shah
  • 304
  • 3
  • 18