Skip to content

Commit

Permalink
Decorate UIApplicationDelegate wrappers with matching UIKit deprecati…
Browse files Browse the repository at this point in the history
…on (flutter#9304)
  • Loading branch information
jmagman authored Jun 13, 2019
1 parent 0df44e9 commit 1caff8d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 10 deletions.
13 changes: 8 additions & 5 deletions shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ typedef void (*FlutterPluginRegistrantCallback)(NSObject<FlutterPluginRegistry>*
/**
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- (void)application:(UIApplication*)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings;
#pragma GCC diagnostic pop
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings
API_DEPRECATED(
"See -[UIApplicationDelegate application:didRegisterUserNotificationSettings:] deprecation",
ios(8.0, 10.0));

/**
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
Expand All @@ -145,7 +145,10 @@ typedef void (*FlutterPluginRegistrantCallback)(NSObject<FlutterPluginRegistry>*
* Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/
- (void)application:(UIApplication*)application
didReceiveLocalNotification:(UILocalNotification*)notification;
didReceiveLocalNotification:(UILocalNotification*)notification
API_DEPRECATED(
"See -[UIApplicationDelegate application:didReceiveLocalNotification:] deprecation",
ios(4.0, 10.0));

/**
* Calls all plugins registered for `UNUserNotificationCenterDelegate` callbacks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ FLUTTER_EXPORT
/**
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- (void)application:(UIApplication*)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings;
#pragma GCC diagnostic pop
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings
API_DEPRECATED(
"See -[UIApplicationDelegate application:didRegisterUserNotificationSettings:] deprecation",
ios(8.0, 10.0));

/**
* Calls all plugins registered for `UIApplicationDelegate` callbacks.
Expand All @@ -90,7 +90,10 @@ FLUTTER_EXPORT
* Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/
- (void)application:(UIApplication*)application
didReceiveLocalNotification:(UILocalNotification*)notification;
didReceiveLocalNotification:(UILocalNotification*)notification
API_DEPRECATED(
"See -[UIApplicationDelegate application:didReceiveLocalNotification:] deprecation",
ios(4.0, 10.0));

/**
* Calls all plugins registered for `UNUserNotificationCenterDelegate` callbacks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,13 @@ - (void)application:(UIApplication*)application
didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- (void)application:(UIApplication*)application
didReceiveLocalNotification:(UILocalNotification*)notification {
[_lifeCycleDelegate application:application didReceiveLocalNotification:notification];
}
#pragma GCC diagnostic pop

- (void)userNotificationCenter:(UNUserNotificationCenter*)center
willPresentNotification:(UNNotification*)notification
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ - (void)application:(UIApplication*)application
}
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- (void)application:(UIApplication*)application
didReceiveLocalNotification:(UILocalNotification*)notification {
for (id<FlutterPlugin> plugin in _pluginDelegates) {
Expand All @@ -239,6 +241,7 @@ - (void)application:(UIApplication*)application
}
}
}
#pragma GCC diagnostic pop

- (void)userNotificationCenter:(UNUserNotificationCenter*)center
willPresentNotification:(UNNotification*)notification
Expand Down

0 comments on commit 1caff8d

Please sign in to comment.