Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are private APIs

What does Apple mean when they refer to private APIs?

like image 886
TheLearner Avatar asked Jun 08 '10 19:06

TheLearner


People also ask

When should I use private API?

Essentially then, the goal of a private API program is to enable internal developers who are building new applications that leverage existing systems. Therefore, the needs and preferences of these devs should drive the decisions made by business managers and interface developers who are implementing the program.

What makes an API public?

An open API, also called public API, is an application programming interface made publicly available to software developers. Open APIs are published on the internet and shared freely, allowing the owner of a network-accessible service to give a universal access to consumers.

What is a private API Apple?

Private APIs provide a way of accessing parameters or functions that aren't documented in a publicly released software development kit (SDK) or a related project. Developers working for Apple can use its private APIs as needed, but the company's App Store rules disallow third-party developers from doing the same.

How do I make my API private?

Step 2: Create a private API You create a private API to allow only clients within your VPC to access it. Sign in to the API Gateway console at https://console.amazonaws.cn/apigateway . Choose Create API, and then for REST API, choose Build.


2 Answers

Undocumented API's, or API's they haven't explicitly exposed to the developer.

While you may access them, there is no guarentee that these API's will not change in future revisions to iOS, plus it's a sure fire way to get your app rejected.

like image 107
Alan Avatar answered Sep 17 '22 14:09

Alan


A private method is one that is used as an implementation detail rather than a [public] interface detail. In other languages where public and private methods are more enforceable, private methods typically cannot be called from anything other than the class that they are contained within. The purpose of which is to hide implementation details, or to prevent external reliance on implementation details. For example, NSArray probably has a number of private methods that deal with memory allocation and optimised storage for efficient access.

Objective-C does not have truly private methods; you are free to send whatever message you want to any object, and it may respond to it or it may not. At runtime, you are also able to inspect exactly which messages a class (and its instances) will respond to through a series of Objective-C Runtime API calls [that are publicly documented].

Some people attempt to use private methods to obtain program behaviour that is not possible with the publicly documented interface; perhaps as an optimisation, perhaps to do something that the API was never meant to do. It is easily possible because of Objective-C's dynamic nature and lack of true private methods.

As a side note; Apple typically use a leading underscore in method names to denote that it is private. Apple also state that method names beginning with an underscore are reserved for Apple only.

like image 40
dreamlax Avatar answered Sep 17 '22 14:09

dreamlax