Update notification icon
This commit is contained in:
parent
463f8e6bac
commit
f8cbcb2908
16 changed files with 316 additions and 35 deletions
|
@ -0,0 +1,29 @@
|
|||
#import <OneSignalFramework/OneSignalFramework.h>
|
||||
|
||||
#import "NotificationService.h"
|
||||
|
||||
@interface NotificationService ()
|
||||
|
||||
@property (nonatomic, strong) void (^contentHandler)(UNNotificationContent *contentToDeliver);
|
||||
@property (nonatomic, strong) UNNotificationRequest *receivedRequest;
|
||||
@property (nonatomic, strong) UNMutableNotificationContent *bestAttemptContent;
|
||||
|
||||
@end
|
||||
|
||||
@implementation NotificationService
|
||||
|
||||
- (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent * _Nonnull))contentHandler {
|
||||
self.receivedRequest = request;
|
||||
self.contentHandler = contentHandler;
|
||||
self.bestAttemptContent = [request.content mutableCopy];
|
||||
[OneSignal didReceiveNotificationExtensionRequest:self.receivedRequest
|
||||
withMutableNotificationContent:self.bestAttemptContent
|
||||
withContentHandler:self.contentHandler];
|
||||
}
|
||||
|
||||
- (void)serviceExtensionTimeWillExpire {
|
||||
[OneSignal serviceExtensionTimeWillExpireRequest:self.receivedRequest withMutableNotificationContent:self.bestAttemptContent];
|
||||
self.contentHandler(self.bestAttemptContent);
|
||||
}
|
||||
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue