Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apple and private APIs

Now that it's public knowledge that App Store submissions are being tested for use of private APIs, I need to ask the question... what exactly is a private API so that I may avoid them?

like image 824
RyJ Avatar asked Nov 20 '09 22:11

RyJ


People also ask

What is a private API Apple?

In fact, Apple doesn't refer to "private APIs" as such. Instead they publish developer documentation that includes API references and header files, and they then recommend that developers only use those publicly documented APIs. So called "private APIs" are what Apple actually calls "non-public APIs".

What is an example of a private API?

One example of a private API is Home-Cost, a home building cost calculator. Home-Cost is provided as a customized installation for each client. The API might be made available through a home building supply store, enabling customers to pick the supplies to complete their projects with running tallies of costs.

Does Apple have an API?

The Sign in with Apple REST API is a web service that connects you to Apple's authentication servers. Use this service to generate and validate the identity tokens used to verify a user's identity. To sign in from a web app or other platform, like Android, use Sign in with Apple JS.

How many APIs does Apple have?

Apple has helped this thriving community of small developers build incredible apps with more than 250,000 application programming interfaces (APIs) included in 40 software development kits (SDKs).


2 Answers

A private API is an API that is not documented in the SDK. For instance, a framework class might declare a method that is not intended to be used by outside developers. The behavior of a private API is not guaranteed. You can't even be sure that the method will be there in the future updates of the platform. Its declaration is probably not available in publicly distributed SDK header files. If you stick to things publicly defined in the SDK documentation, you'll be OK.

like image 74
mmx Avatar answered Sep 19 '22 23:09

mmx


You will find it difficult to use a private API by accident. They are not documented within the SDK docs, and they don't show up in XCode's code completion suggestions.

The reason this has become news recently is the creator of a framework used by several apps used a private API, so when developers who included his framework updated their apps, they were rejected (even though THOSE developers didn't use a private API, the framework they added to their application did).

That's about the only way you could possibly use a private API accidentally.

like image 39
mmc Avatar answered Sep 18 '22 23:09

mmc