Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,14 @@ - (void)application:(UIApplication*)application
- (void)userNotificationCenter:(UNUserNotificationCenter*)center
willPresentNotification:(UNNotification*)notification
withCompletionHandler:
(void (^)(UNNotificationPresentationOptions options))completionHandler {
if ([_lifeCycleDelegate respondsToSelector:_cmd]) {
[_lifeCycleDelegate userNotificationCenter:center
willPresentNotification:notification
withCompletionHandler:completionHandler];
(void (^)(UNNotificationPresentationOptions options))completionHandler
NS_AVAILABLE_IOS(10_0) {
if (@available(iOS 10.0, *)) {
if ([_lifeCycleDelegate respondsToSelector:_cmd]) {
[_lifeCycleDelegate userNotificationCenter:center
willPresentNotification:notification
withCompletionHandler:completionHandler];
}
}
}

Expand All @@ -96,11 +99,13 @@ - (void)userNotificationCenter:(UNUserNotificationCenter*)center
*/
- (void)userNotificationCenter:(UNUserNotificationCenter*)center
didReceiveNotificationResponse:(UNNotificationResponse*)response
withCompletionHandler:(void (^)(void))completionHandler {
if ([_lifeCycleDelegate respondsToSelector:_cmd]) {
[_lifeCycleDelegate userNotificationCenter:center
didReceiveNotificationResponse:response
withCompletionHandler:completionHandler];
withCompletionHandler:(void (^)(void))completionHandler NS_AVAILABLE_IOS(10_0) {
if (@available(iOS 10.0, *)) {
if ([_lifeCycleDelegate respondsToSelector:_cmd]) {
[_lifeCycleDelegate userNotificationCenter:center
didReceiveNotificationResponse:response
withCompletionHandler:completionHandler];
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,24 +275,29 @@ - (void)application:(UIApplication*)application
- (void)userNotificationCenter:(UNUserNotificationCenter*)center
willPresentNotification:(UNNotification*)notification
withCompletionHandler:
(void (^)(UNNotificationPresentationOptions options))completionHandler {
for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
if ([delegate respondsToSelector:_cmd]) {
[delegate userNotificationCenter:center
willPresentNotification:notification
withCompletionHandler:completionHandler];
(void (^)(UNNotificationPresentationOptions options))completionHandler
NS_AVAILABLE_IOS(10_0) {
if (@available(iOS 10.0, *)) {
for (NSObject<FlutterApplicationLifeCycleDelegate>* delegate in _delegates) {
if ([delegate respondsToSelector:_cmd]) {
[delegate userNotificationCenter:center
willPresentNotification:notification
withCompletionHandler:completionHandler];
}
}
}
}

- (void)userNotificationCenter:(UNUserNotificationCenter*)center
didReceiveNotificationResponse:(UNNotificationResponse*)response
withCompletionHandler:(void (^)(void))completionHandler {
for (id<FlutterApplicationLifeCycleDelegate> delegate in _delegates) {
if ([delegate respondsToSelector:_cmd]) {
[delegate userNotificationCenter:center
didReceiveNotificationResponse:response
withCompletionHandler:completionHandler];
withCompletionHandler:(void (^)(void))completionHandler NS_AVAILABLE_IOS(10_0) {
if (@available(iOS 10.0, *)) {
for (id<FlutterApplicationLifeCycleDelegate> delegate in _delegates) {
if ([delegate respondsToSelector:_cmd]) {
[delegate userNotificationCenter:center
didReceiveNotificationResponse:response
withCompletionHandler:completionHandler];
}
}
}
}
Expand Down