UNNotificationContentExtension not displayed

I am trying to make a notification about special notifications. I added an extension target and changed the value UNNotificationExtensionCategoryto "drawing."

In my push notification, I added an element "category" : "drawing"to the block aps. A method didReceive(_:)from this extension will never be called. What did I forget to do?

+4
source share
3 answers

You seem to have done what you need. I also had a similar problem not to see the user notification screen. However, what is not indicated in the UNNotificationContentExtension docs is that the custom screen appears only when you make a 3D touch alert. I tried to make a 3D touch and a custom screen appeared. Please check.

+1
source

This method is called only after you click on the notification.

If you track this through LLDB, it works as a separate process. Make sure you create an extension target to access these methods and logs from LLDB.

, , , Info.plist. , . , MyNotificationExtension, NSExtension > NSPrincipalClass MyNotificationExtension.MyNotificationExtensionViewController.

0

You have added this to your target info.plist file instead of ACTIONABLEadddrawing enter image description here

0
source

Source: https://habr.com/ru/post/1654941/


All Articles