Allright, as a follow up to the previous chapter in this odyssey I can now state that, apparently, you cannot submit an electron 6 or 7 app to the apple store:
The first refusal from apple states:
Your app app links against the following non-public framework(s):
I am not the only one having this issue and I did write back to Apple trying to explain that I am using Electron and I can’t really change any of these public-framework usage (I assume is something from Chromium)[…]
There was a time when digging into the bowels of the macOS implementation was “necessary”. Back in the day, you’d use
NSThemeFrameto get UI into an app’s titlebar.
iTunes did it, so everyone wanted to do it.
But those days are long gone – there are public APIs to get the job done now.
And with the advent of Spaces, split-screen windows, and translucent effects, using these private APIs are likely to break an app.
Mozilla recently published a good write up on why they started using the undocumented CALayer API in Firefox 69. The TLDR is that that these private API’s allowed them to get up to 3x better battery usage in Firefox. The article also mentioned that Chrome uses these Core Animation API’s.
So there are a multiple problems here:
- It’s (apparently) impossible for Chromium to get competitive performance and battery life without using private API, which Safari freely uses.
- Apple probably has good reasons for keeping these APIs private.
- Private API has always been banned, but Apple has been accepting these apps for years and then abruptly stopped without any notice.
- Apps using Electron probably didn’t know that they were even using private API. Neither Xcode nor Application Loader reports this, and App Review was accepting the apps.
- The rule is not being enforced equally.
I just checked Slack, which was updated 3 days ago, and its embedded Electron Framework contains all of the listed private symbols.
“And developers, from first-time engineers to larger companies, can rest assured that everyone is playing by the same set of rules.”
This, however, is draconian:
Continuing to use or conceal non-public APIs in future submissions of this app may result in the termination of your Apple Developer account, as well as removal of all associated apps from the App Store.
“Keep trying to submit, and we might just ban you forever” is insane. Every program of any complexity depends on third party libraries, and many people wouldn’t be able to tell what arcane APIs their dependencies (or their dependencies’ dependencies) call. “If you continue to have an upstream dependency that violates our terms, we might permaban you” is bullshit.
This has got to be a big problem for Apple. The widespread distribution of Electron and Chromium means they have to maintain this as semi-public API. Or risk breaking a lot of apps in a future OS release. Google is forcing them into a bad spot.
Good people of Twitter, what are your favorite Catalyst apps? Asking because I am yet to find one that is remotely as good as the Electron apps I use daily.
I’ll be more specific: Slack and Visual Studio Code works great for me, while Postman is a little annoying, but very functional. Meanwhile the Jira and Twitter Catalyst apps have sent me running back for the web.
Update (2019-11-05): anatomisation points out that the Mozilla post does not actually say that they are using private API and that WebKit is not using
CALayerHost very extensively. However, Chromium does seem to be using it for compositing during rendering.
Reminds me of the time people found out Unity was relying on an undocumented API, around the iPhoneOS 3 or iOS 4 timeframe IIRC. I think we were affected too (by direct usage, not through Unity. Our bad.
These private symbols have been in Electron/Chromium for a long time. Strange coincidence that Apple is changing their enforcement now, so soon after Catalyst is available.
That neither Chrome nor Firefox is in the MAS could be considered an indictment of the MAS.
FWIW, Chromium is using
CALayerHostfor something better served by public
IOSurfaceAPIs and public
Stay up-to-date by subscribing to the Comments RSS Feed for this post.
- Previous Post