-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Flutter app references private classes on iOS #124008
Comments
Hello @aj-dt. Could you link to Apple docs specifying that private classes should not be used? |
Hi @exaby73,
Although it does not reference classes directly, Apple are not exactly known for their laissez faire interpretation of their own rules. While this usage has apparently been tolerated, it represents a risk that could start causing rejections at any time. |
This seems very vague to me. It doesn't really specify what the meaning of a "private API" is. I'll leave this for interpretation and label this issue |
Thanks for flagging this! These APIs were used to add blurs on Platform Views (#43902). In the design doc, we called out some risks and a future plan to migrate to use SwiftUI. For now, we will keep this as a lower priority, but we will continue to investigate the migration for the future. |
I wouldn't worry about it - it's not invoking any private methods |
Hello!
Any references to such APIs (which includes selectors, classes, or symbols) all fall into the category of "using a non-public API".
I agree Apple could have been more clear here; they have a known history of not documenting their "blockers" very well (likely on purpose to avoid people finding workarounds). However, their language is more verbose when you actually receive one of the blockers. I'll include some real examples below, but i'd first like to note why I believe this symbol to be non-public:
Now, for some examples of real-world rejection Apple has issued regarding Non-Public API Usage. Apple's internal ID for Non-Public API Usage blockers is
Real examples of developers being blocked:
Real examples of developers being blocked:
You'll see that the last example was on this repo. Flutter was referencing a private symbol, and the Flutter team had to remove it to stay compliant with Apple's rules. Given the precedence of apps being blocked for simply referencing non-public APIs, and the history of the Flutter team recognizing that private APIs should not be used, I'd hope for this issue to be considered higher priority than what I feel it is currently assessed at. Please let me know if you have any questions or if you'd like me to further clarify any of the points I made. I appreciate you taking the time to consider this. Thanks! |
The original code creates an internal `class` which is alarming: `NSClassFromString(@"_UIVisualEffectBackdropView")` This PR removes such usage. *List which issues are fixed by this PR. You must list at least one issue.* Fixes flutter/flutter#124008 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Flutter apps reference private classes
__UIVisualEffectBackdropView
and__UIVisualEffectSubview
on iOS.Although this has so far not resulted in app rejections, it is a risk factor for anyone relying on the Flutter platform given Apple's notoriously opaque app submission process.
Steps to Reproduce
This is visible directly in the code, e.g. FlutterPlatformViews_Internal.mm:
Or, if one unpacks a flutter-built ipa:
Expected results:
There would be no reference to private iOS classes
Actual results:
As of flutter 3.7.8 there are references to two private classes:
Code sample
Logs
The text was updated successfully, but these errors were encountered: