0

I am using sailThru in my iOS app, i need to show Rich Notification when triggered from sailThru dashboard. But notification arrives as simple push, instead it should arrive as Rich notification.

Also, override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) of UNNotificationServiceExtension doesn't gets called.

Please help me, why it doesn't get called. Thanks

Programming Learner
  • 4,351
  • 3
  • 22
  • 34
  • Make sure your payload contains `content-available : 1` – Lal Krishna Jan 15 '19 at 09:33
  • May i know did u use notification extension for RICH notification . 1. https://www.shinobicontrols.com/blog/ios-10-day-by-day-day-6-notification-content-extensions . 2. https://www.pluralsight.com/guides/creating-ios-rich-push-notifications – Gagan_iOS Jan 15 '19 at 09:45

3 Answers3

0

If you believe everything is fully-setup such as the payload that your server is passing to your app (not to mention Krishna's comment, payload should include: content-available : 1), NotificationServiceExtension, NotificationContentExtension, and whatnot, then there should be no problem.

Now, to get the override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) method triggered (such as triggering your breakpoint in there), you need to run your app using your NotificationService target.

I hope this helps.

Glenn Posadas
  • 12,555
  • 6
  • 54
  • 95
0

One thing you should check is that your NotificationServiceExtension is not taking too much memory (RAM) as it runs on a separate process and it can be killed by the OS if it takes more than few Mb. Console app can be helpful to debug this kind of issues.

Mosbah
  • 1,347
  • 1
  • 14
  • 28
0

To get Rich Notification make sure to add "mutable_content" key in the payload, also we need to configure all required UNUserNotification settings to achieve this.

I got to fixed this.

Programming Learner
  • 4,351
  • 3
  • 22
  • 34