7

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!

Konstantin Loginov
  • 15,802
  • 5
  • 58
  • 95

1 Answers1

4

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.

Omer Malik
  • 409
  • 7
  • 15