Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UNNotificationContentExtension not displaying

I'm trying to make a custom notification alert. I added my extension target and changed the UNNotificationExtensionCategory value to 'drawing'.

In my push notification I added a "category" : "drawing" element to the aps block. The didReceive(_:) method from that extension is never getting called though. What did I forget to do?

like image 432
Gargoyle Avatar asked Dec 25 '22 01:12

Gargoyle


2 Answers

You seem to have done whats needed. I too had similar problem of not seeing the custom notification screen. However, whats not mentioned in the documents of UNNotificationContentExtension is that the custom screen appears only when you do a 3D touch on the notification alert. I tried to do a 3D touch and the custom screen appeared. Please check.

like image 164
Sharath Avatar answered Jan 17 '23 22:01

Sharath


First check that the extension category is set appropriately in the extension info.plist file to match what is being sent in the aps block of your push notification

Second check that the deployment target for the extension is <= to the iOS version of the device you're trying to run on.

like image 32
user564904 Avatar answered Jan 17 '23 23:01

user564904