From 1caff8d073581e4960aa937fb5e0411dfdf10a56 Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Thu, 13 Jun 2019 10:16:42 -0700 Subject: [PATCH] Decorate UIApplicationDelegate wrappers with matching UIKit deprecation (#9304) --- .../darwin/ios/framework/Headers/FlutterPlugin.h | 13 ++++++++----- .../Headers/FlutterPluginAppLifeCycleDelegate.h | 13 ++++++++----- .../ios/framework/Source/FlutterAppDelegate.mm | 3 +++ .../Source/FlutterPluginAppLifeCycleDelegate.mm | 3 +++ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h index 9f5c8c3541db0..8d63dbc02caad 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPlugin.h @@ -120,11 +120,11 @@ typedef void (*FlutterPluginRegistrantCallback)(NSObject* /** * 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. @@ -145,7 +145,10 @@ typedef void (*FlutterPluginRegistrantCallback)(NSObject* * 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. diff --git a/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h b/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h index d593606b6ff8f..b791d907a59f5 100644 --- a/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h +++ b/shell/platform/darwin/ios/framework/Headers/FlutterPluginAppLifeCycleDelegate.h @@ -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. @@ -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. diff --git a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm index f0dd78e111457..b918437cf6f69 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterAppDelegate.mm @@ -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 diff --git a/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm b/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm index afeff246fcd82..37016945dfd8d 100644 --- a/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm +++ b/shell/platform/darwin/ios/framework/Source/FlutterPluginAppLifeCycleDelegate.mm @@ -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 plugin in _pluginDelegates) { @@ -239,6 +241,7 @@ - (void)application:(UIApplication*)application } } } +#pragma GCC diagnostic pop - (void)userNotificationCenter:(UNUserNotificationCenter*)center willPresentNotification:(UNNotification*)notification