Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

didReceiveNotificationRequest:withContentHandler - execution time limit?

UNNotificationServiceExtension has a method didReceiveNotificationRequest:withContentHandler to handle notification change.

It has a very ambiguous description, regarding timeout time:

That method has a limited amount of time to perform its task and execute the provided completion block. If your method does not finish in time,

And here's a description of serviceExtensionTimeWillExpire method:

If your didReceiveNotificationRequest:withContentHandler: method takes to long to execute its completion block, the system calls this method on a separate thread to give you one last chance to execute the block.

I don't fully get, what "to long to execute" means. Does it have any quantitative data? Does it vary on device it runs, etc.?

Thanks!

like image 902
Konstantin Loginov Avatar asked Aug 24 '16 12:08

Konstantin Loginov


1 Answers

https://developer.apple.com/reference/usernotifications/unnotificationserviceextension/1648229-didreceivenotificationrequest?language=objc#discussion

Taken from Apple docs above link.

Your extension has a limited amount of time (no more than 30 seconds) to modify the content and execute the contentHandler block.

like image 96
Omer Malik Avatar answered Nov 15 '22 04:11

Omer Malik