Commit cbfe67ca by Sebastián Katzer

Call the saved delegate not only for push notifications

parent 63c99d3e
...@@ -507,12 +507,12 @@ ...@@ -507,12 +507,12 @@
{ {
UNNotificationRequest* toast = notification.request; UNNotificationRequest* toast = notification.request;
if ([toast.trigger isKindOfClass:UNPushNotificationTrigger.class]) { [_delegate userNotificationCenter:center
[_delegate userNotificationCenter:center willPresentNotification:notification
willPresentNotification:notification withCompletionHandler:completionHandler];
withCompletionHandler:completionHandler];
if ([toast.trigger isKindOfClass:UNPushNotificationTrigger.class])
return; return;
}
APPNotificationOptions* options = toast.options; APPNotificationOptions* options = toast.options;
...@@ -539,14 +539,14 @@ ...@@ -539,14 +539,14 @@
{ {
UNNotificationRequest* toast = response.notification.request; UNNotificationRequest* toast = response.notification.request;
[_delegate userNotificationCenter:center
didReceiveNotificationResponse:response
withCompletionHandler:completionHandler];
completionHandler(); completionHandler();
if ([toast.trigger isKindOfClass:UNPushNotificationTrigger.class]) { if ([toast.trigger isKindOfClass:UNPushNotificationTrigger.class])
[_delegate userNotificationCenter:center
didReceiveNotificationResponse:response
withCompletionHandler:completionHandler];
return; return;
}
NSMutableDictionary* data = [[NSMutableDictionary alloc] init]; NSMutableDictionary* data = [[NSMutableDictionary alloc] init];
NSString* action = response.actionIdentifier; NSString* action = response.actionIdentifier;
...@@ -585,8 +585,8 @@ ...@@ -585,8 +585,8 @@
{ {
eventQueue = [[NSMutableArray alloc] init]; eventQueue = [[NSMutableArray alloc] init];
_center = [UNUserNotificationCenter currentNotificationCenter]; _center = [UNUserNotificationCenter currentNotificationCenter];
_delegate = _center.delegate;
_delegate = _center.delegate;
_center.delegate = self; _center.delegate = self;
[_center registerGeneralNotificationCategory]; [_center registerGeneralNotificationCategory];
...@@ -715,4 +715,3 @@ ...@@ -715,4 +715,3 @@
} }
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment