unnotificationserviceextension

Test Rich Notifications in Simulator

感情迁移 提交于 2021-02-04 07:29:08
问题 I am able to test the normal notifications in Simulator, but when I tried to test rich notifications nothing happens, event title is not getting updated. Could you please assist me, how to proceed. Do I need to change any simulator settings? I am using Xcode 11.4 Sample Payload : { "aps": { "mutable-content": 1, "alert": { "body": "Push notification body", "title": "Push notification title" } }, "media-url": "https://i.imgur.com/t4WGJQx.jpg" } NotificationService Extension Method: - (void

Unable to schedule a task from within a UNNotificationServiceExtension - Error: BGTaskSchedulerErrorDomain error 1

こ雲淡風輕ζ 提交于 2021-01-28 12:56:50
问题 As the title states, i am currently unable to schedule a task from within a UNNotificationServiceExtension. I would like to schedule the task when the following function is called and thus a push is received: func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) Currently as soon as i call: try BGTaskScheduler.shared.submit(request) The catch clause is entered and the following error is returned: 'The operation couldn’t

Will iOS Notification Service Extension delete attached file from device?

狂风中的少年 提交于 2021-01-27 06:48:58
问题 I got a strange problem. iOS Notification Service Extension will delete the attachment from device. I use SDWebImage to display and cache image, and I implemented a Notification Service Extension to display a image in the notification alert view. In my case, the image was already cached locally. Then, I click home button, my app was running in background, app scheduled a local notification with the cached image attach into the notification content. See the code bellow: 1.Schedule a local

Will iOS Notification Service Extension delete attached file from device?

夙愿已清 提交于 2021-01-27 06:47:01
问题 I got a strange problem. iOS Notification Service Extension will delete the attachment from device. I use SDWebImage to display and cache image, and I implemented a Notification Service Extension to display a image in the notification alert view. In my case, the image was already cached locally. Then, I click home button, my app was running in background, app scheduled a local notification with the cached image attach into the notification content. See the code bellow: 1.Schedule a local

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

Rich push notification not working with FCM in IOS

我与影子孤独终老i 提交于 2019-12-25 02:14:48
问题 I've added UNNotificationServiceExtension and UNNotificationContentExtension in my project for rich push notification. Please refer the code below which i've added for the same. Code: #import "NotificationService.h" @interface NotificationService () @property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver); @property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent; @end @implementation NotificationService { NSURLSession *session; } -

Notification service extension - hide previous notifications

岁酱吖の 提交于 2019-12-23 22:27:13
问题 Take, for instance, a messaging app that only presents notifications with in this format: You have X new messages When the user receives a message, the app will present a notification: You have 1 new message When it receives a second message, a new notification will be shown: You have 2 new messages Ideally, after receiving the second notification, the first one should be cancelled/hidden, as the user has only 2 new messages, instead of 1 + 2. If notifications are locally presented using