Commit ef16347a by Sebastián Katzer

Shorten some var names to be more readable

parent cbfe67ca
...@@ -38,6 +38,11 @@ ...@@ -38,6 +38,11 @@
@implementation APPLocalNotification @implementation APPLocalNotification
UNNotificationPresentationOptions const OptionNone = UNNotificationPresentationOptionNone;
UNNotificationPresentationOptions const OptionBadge = UNNotificationPresentationOptionBadge;
UNNotificationPresentationOptions const OptionSound = UNNotificationPresentationOptionSound;
UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentationOptionAlert;
@synthesize deviceready, isActive, eventQueue; @synthesize deviceready, isActive, eventQueue;
#pragma mark - #pragma mark -
...@@ -503,13 +508,13 @@ ...@@ -503,13 +508,13 @@
*/ */
- (void) userNotificationCenter:(UNUserNotificationCenter *)center - (void) userNotificationCenter:(UNUserNotificationCenter *)center
willPresentNotification:(UNNotification *)notification willPresentNotification:(UNNotification *)notification
withCompletionHandler:(void (^)(UNNotificationPresentationOptions))completionHandler withCompletionHandler:(void (^)(UNNotificationPresentationOptions))handler
{ {
UNNotificationRequest* toast = notification.request; UNNotificationRequest* toast = notification.request;
[_delegate userNotificationCenter:center [_delegate userNotificationCenter:center
willPresentNotification:notification willPresentNotification:notification
withCompletionHandler:completionHandler]; withCompletionHandler:handler];
if ([toast.trigger isKindOfClass:UNPushNotificationTrigger.class]) if ([toast.trigger isKindOfClass:UNPushNotificationTrigger.class])
return; return;
...@@ -521,11 +526,11 @@ ...@@ -521,11 +526,11 @@
} }
if (options.silent) { if (options.silent) {
completionHandler(UNNotificationPresentationOptionNone); handler(OptionNone);
} else if (!isActive || options.priority > 0) { } else if (!isActive || options.priority > 0) {
completionHandler(UNNotificationPresentationOptionBadge|UNNotificationPresentationOptionSound|UNNotificationPresentationOptionAlert); handler(OptionBadge|OptionSound|OptionAlert);
} else { } else {
completionHandler(UNNotificationPresentationOptionBadge|UNNotificationPresentationOptionSound); handler(OptionBadge|OptionSound);
} }
} }
...@@ -535,15 +540,15 @@ ...@@ -535,15 +540,15 @@
*/ */
- (void) userNotificationCenter:(UNUserNotificationCenter *)center - (void) userNotificationCenter:(UNUserNotificationCenter *)center
didReceiveNotificationResponse:(UNNotificationResponse *)response didReceiveNotificationResponse:(UNNotificationResponse *)response
withCompletionHandler:(void (^)(void))completionHandler withCompletionHandler:(void (^)(void))handler
{ {
UNNotificationRequest* toast = response.notification.request; UNNotificationRequest* toast = response.notification.request;
[_delegate userNotificationCenter:center [_delegate userNotificationCenter:center
didReceiveNotificationResponse:response didReceiveNotificationResponse:response
withCompletionHandler:completionHandler]; withCompletionHandler:handler];
completionHandler(); handler();
if ([toast.trigger isKindOfClass:UNPushNotificationTrigger.class]) if ([toast.trigger isKindOfClass:UNPushNotificationTrigger.class])
return; return;
......
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