Decorate UIApplicationDelegate wrappers with matching UIKit deprecation (flutter/engine#9304)

This commit is contained in:
Jenn Magder
2019-06-13 10:16:42 -07:00
committed by GitHub
parent c913c07e29
commit 23b2997ec0
4 changed files with 22 additions and 10 deletions

View File

@@ -120,11 +120,11 @@ typedef void (*FlutterPluginRegistrantCallback)(NSObject<FlutterPluginRegistry>*
/** /**
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks. * Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/ */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- (void)application:(UIApplication*)application - (void)application:(UIApplication*)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings; didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings
#pragma GCC diagnostic pop API_DEPRECATED(
"See -[UIApplicationDelegate application:didRegisterUserNotificationSettings:] deprecation",
ios(8.0, 10.0));
/** /**
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks. * Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
@@ -145,7 +145,10 @@ typedef void (*FlutterPluginRegistrantCallback)(NSObject<FlutterPluginRegistry>*
* Calls all plugins registered for `UIApplicationDelegate` callbacks. * Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/ */
- (void)application:(UIApplication*)application - (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. * Calls all plugins registered for `UNUserNotificationCenterDelegate` callbacks.

View File

@@ -67,11 +67,11 @@ FLUTTER_EXPORT
/** /**
* Called if this plugin has been registered for `UIApplicationDelegate` callbacks. * Called if this plugin has been registered for `UIApplicationDelegate` callbacks.
*/ */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- (void)application:(UIApplication*)application - (void)application:(UIApplication*)application
didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings; didRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings
#pragma GCC diagnostic pop API_DEPRECATED(
"See -[UIApplicationDelegate application:didRegisterUserNotificationSettings:] deprecation",
ios(8.0, 10.0));
/** /**
* Calls all plugins registered for `UIApplicationDelegate` callbacks. * Calls all plugins registered for `UIApplicationDelegate` callbacks.
@@ -90,7 +90,10 @@ FLUTTER_EXPORT
* Calls all plugins registered for `UIApplicationDelegate` callbacks. * Calls all plugins registered for `UIApplicationDelegate` callbacks.
*/ */
- (void)application:(UIApplication*)application - (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. * Calls all plugins registered for `UNUserNotificationCenterDelegate` callbacks.

View File

@@ -92,10 +92,13 @@ static NSString* kBackgroundFetchCapatibility = @"fetch";
didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- (void)application:(UIApplication*)application - (void)application:(UIApplication*)application
didReceiveLocalNotification:(UILocalNotification*)notification { didReceiveLocalNotification:(UILocalNotification*)notification {
[_lifeCycleDelegate application:application didReceiveLocalNotification:notification]; [_lifeCycleDelegate application:application didReceiveLocalNotification:notification];
} }
#pragma GCC diagnostic pop
- (void)userNotificationCenter:(UNUserNotificationCenter*)center - (void)userNotificationCenter:(UNUserNotificationCenter*)center
willPresentNotification:(UNNotification*)notification willPresentNotification:(UNNotification*)notification

View File

@@ -228,6 +228,8 @@ static BOOL isPowerOfTwo(NSUInteger x) {
} }
} }
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
- (void)application:(UIApplication*)application - (void)application:(UIApplication*)application
didReceiveLocalNotification:(UILocalNotification*)notification { didReceiveLocalNotification:(UILocalNotification*)notification {
for (id<FlutterPlugin> plugin in _pluginDelegates) { for (id<FlutterPlugin> plugin in _pluginDelegates) {
@@ -239,6 +241,7 @@ static BOOL isPowerOfTwo(NSUInteger x) {
} }
} }
} }
#pragma GCC diagnostic pop
- (void)userNotificationCenter:(UNUserNotificationCenter*)center - (void)userNotificationCenter:(UNUserNotificationCenter*)center
willPresentNotification:(UNNotification*)notification willPresentNotification:(UNNotification*)notification