unnotificationattachment

What is the file size limit in temporary directory in iOS?

随声附和 提交于 2019-12-25 19:07:41
问题 I am trying to save an image of size 7.9MB downloaded from here. But at line 'try data.write...' the extension crashes and I get this in console. kernel EXC_RESOURCE -> Notification Extension[3137] exceeded mem limit: ActiveHard 12 MB (fatal) kernel 46710.034 memorystatus: killing_specific_process pid 3137 [Notification Extension] (per-process-limit 3) - memorystatus_available_pages: 73906 ReportCrash starting prolongation transaction timer default 18:39:53.104640 +0530 ReportCrash Process

UNNotificationAttachment with UIImage or Remote URL

99封情书 提交于 2019-11-28 09:53:01
In my Notification Service Extension I am downloading an image from a URL to show as UNNotificationAttachment in a notification. So I have this image as UIImage and don't see the need to write it in my app directory / group container on disc just to set up the notification. Is there a good way create an UNNotificationAttachment with a UIImage ? (should be appliable to local and remote notifications) MarkHim create directory in tmp folder write the NSData representation of the UIImage into the newly created directory create the UNNotificationAttachment with url to the file in tmp folder clean

UNNotificationAttachment with UIImage or Remote URL

醉酒当歌 提交于 2019-11-27 03:17:26
问题 In my Notification Service Extension I am downloading an image from a URL to show as UNNotificationAttachment in a notification. So I have this image as UIImage and don't see the need to write it in my app directory / group container on disc just to set up the notification. Is there a good way create an UNNotificationAttachment with a UIImage ? (should be appliable to local and remote notifications) 回答1: create directory in tmp folder write the NSData representation of the UIImage into the