Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decorate UIApplicationDelegate wrappers with matching UIKit deprecation #9304

Merged
merged 2 commits into from
Jun 13, 2019

Conversation

jmagman
Copy link
Member

@jmagman jmagman commented Jun 12, 2019

The API added in #6858 used deprecated UIKit symbols. Add the API_DEPRECATED decorators to match the UIApplicationDelegate deprecation.

  1. Projects targeting iOS SDK 10 and greater will no longer see a build warning.
  2. Projects targeting less than iOS SDK 10 will continue to not see a build warning.
  3. Code will generate a build warning if it actually uses the deprecated UIKit APIs in projects targeting iOS SDK 10 and greater. This will let developers know it's no longer supported by UIKit and to migrate to something else.

Change the deprecation suppression added in #6672 to the finer-grained API_DEPRECATED to generate warnings where appropriate.

Fixes flutter/flutter#26094.

@@ -92,10 +92,13 @@ - (void)application:(UIApplication*)application
didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}

#pragma GCC diagnostic push
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overall looks good, are these the best we can do though? Would it make any sense to just conditionally compile them instead based on the SDK level?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want the symbol to disappear if they change the deployment target. As of March, all apps submitted to the App Store must use iOS SDK 12, and the flutter create template defaults to iOS 8. Since the replacement APIs aren't drag-and-drop, it will probably take some thought for developers to move off of them, and I don't want them to rush the process because they need to make an App Store submission to, say, fix a critical bug, but they can't compile because this symbol is gone. I'd rather pass the buck of behavior changes off to UIKit and give developers a warning that they need to swap it out.

Deprecating in the header and suppressing the deprecation warning in the implementation is the strange but standard pattern. :-(

@jmagman jmagman merged commit 1caff8d into flutter:master Jun 13, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 13, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 13, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 13, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 13, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 14, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 14, 2019
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 14, 2019
liyuqian pushed a commit to flutter/flutter that referenced this pull request Jun 14, 2019
flutter/engine@f1d821d...6f5347c

git log f1d821d..6f5347c --no-merges --oneline
6f5347c MessageLoopTaskQueue schedules Wakes (flutter/engine#9316)
b9c790e Roll src/third_party/skia 1127c0b273ea..4c4945a25248 (9 commits) (flutter/engine#9323)
6aaf5b3 Build the GLFW shell on Linux host builds but not target builds (flutter/engine#9320)
1121fda Added class docstrings for classes inside of shell/common. (flutter/engine#9303)
96a592b [macos] Adds clipboard string read/write support to macOS (flutter/engine#9313)
1cf980f Roll src/third_party/skia 569f12f0e503..1127c0b273ea (13 commits) (flutter/engine#9317)
14b0414 Update the Dart version to 1d8b81283c1dee38f1dd87b71b16aa1648b01155 (flutter/engine#9318)
54ff3c5 Avoid using std::unary_function (flutter/engine#9314)
031c2dc Only build embedder unit tests for host builds (flutter/engine#9315)
219c1cd Roll src/third_party/skia 084fa1b52f30..569f12f0e503 (3 commits) (flutter/engine#9311)
1caff8d Decorate UIApplicationDelegate wrappers with matching UIKit deprecation (flutter/engine#9304)
0df44e9 [scene_host] Expose Opacity and remove ExportNode (flutter/engine#9297)
fe7e444 Refactor: move Task Queue to its own class (flutter/engine#9301)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff (liyuqian@google.com), and stop
the roller if necessary.
kiku-jw pushed a commit to kiku-jw/flutter that referenced this pull request Jun 14, 2019
flutter/engine@f1d821d...6f5347c

git log f1d821d..6f5347c --no-merges --oneline
6f5347c MessageLoopTaskQueue schedules Wakes (flutter/engine#9316)
b9c790e Roll src/third_party/skia 1127c0b273ea..4c4945a25248 (9 commits) (flutter/engine#9323)
6aaf5b3 Build the GLFW shell on Linux host builds but not target builds (flutter/engine#9320)
1121fda Added class docstrings for classes inside of shell/common. (flutter/engine#9303)
96a592b [macos] Adds clipboard string read/write support to macOS (flutter/engine#9313)
1cf980f Roll src/third_party/skia 569f12f0e503..1127c0b273ea (13 commits) (flutter/engine#9317)
14b0414 Update the Dart version to 1d8b81283c1dee38f1dd87b71b16aa1648b01155 (flutter/engine#9318)
54ff3c5 Avoid using std::unary_function (flutter/engine#9314)
031c2dc Only build embedder unit tests for host builds (flutter/engine#9315)
219c1cd Roll src/third_party/skia 084fa1b52f30..569f12f0e503 (3 commits) (flutter/engine#9311)
1caff8d Decorate UIApplicationDelegate wrappers with matching UIKit deprecation (flutter/engine#9304)
0df44e9 [scene_host] Expose Opacity and remove ExportNode (flutter/engine#9297)
fe7e444 Refactor: move Task Queue to its own class (flutter/engine#9301)

The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff (liyuqian@google.com), and stop
the roller if necessary.
@jmagman jmagman deleted the deprecated branch December 2, 2019 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Updated XCode project's Deployment Target to iOS 10+: 'UILocalNotification' is deprecated
3 participants