You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a situation in iOS where PNs coming into a phone that has our app either in a quit state or in the background are taking too long to be processed by Notifee which then falls back to using self.contentHandler(self.bestAttemptContent); in serviceExtensionTimeWillExpire. In doing that, the PN that shows up is very plain and not actionable because Notifee did not have a chance to apply all of the notifeeOptions in the original payload. Is there a best practice around this? I have no idea why the app is not able to mutate the PN payload in time, still trying to track that down. Apparently they have 30 seconds... I would think the small Notifee service extension app that gets sideloaded wouldn't take that long to boot up to handle the PN. This is what the whole file looks like
#import"NotificationService.h"
#import"NotifeeExtensionHelper.h"@interfaceNotificationService ()
@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;
@end@implementationNotificationService
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)requestwithContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
self.contentHandler = contentHandler;
self.bestAttemptContent = [request.content mutableCopy];
[NotifeeExtensionHelper populateNotificationContent:request
withContent:self.bestAttemptContent
withContentHandler:contentHandler];
}
- (void)serviceExtensionTimeWillExpire {
// Called just before the extension will be terminated by the system.// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
self.contentHandler(self.bestAttemptContent);
}
@end
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Greetings,
We have a situation in iOS where PNs coming into a phone that has our app either in a quit state or in the background are taking too long to be processed by Notifee which then falls back to using
self.contentHandler(self.bestAttemptContent);
inserviceExtensionTimeWillExpire
. In doing that, the PN that shows up is very plain and not actionable because Notifee did not have a chance to apply all of thenotifeeOptions
in the original payload. Is there a best practice around this? I have no idea why the app is not able to mutate the PN payload in time, still trying to track that down. Apparently they have 30 seconds... I would think the small Notifee service extension app that gets sideloaded wouldn't take that long to boot up to handle the PN. This is what the whole file looks likeBeta Was this translation helpful? Give feedback.
All reactions