Your app contains non-public API usage - ios

I'm trying to submit my app on the App Store but I'm getting this msg:
Your app contains non-public API usage. Please review the errors, correct them, and resubmit your application.
The app references non-public symbols in Payload/XXX.app/XXX: CFUserNotificationDisplayNotice
Where "XXX" -- application name.
Can anybody help me with this issue?

A private API is an API that is not intended to be used by outside developers. This is to prevent breaking changes when the SDK is updated.
The behavior of a private API is not guaranteed. The methods may be removed in the future updates of the platform.
You can use the private API's in you OSX and iOS apps if you don't intend to release through Apple App Store, but then, again you yourself need to make sure that your app is not broken by the comming SDK/OS updates.
Either you or some third party framework in your bundle is using private APIs
Remove the signature mentioned from the code and you should be fine.

Related

App is rejected using non-public API LSApplicationWorkspace

My iOS App is rejected from Apple Store review with the following issue:
Your app uses or references the following non-public APIs:
LSApplicationWorkspace, defaultWorkspace
The use of non-public APIs is not permitted on the App Store because
it can lead to a poor user experience should these APIs change.
But I can find any code about these APIs. Anyone know which part will contain these APIs ?
My blindfold shot in the dark (edit: not sure why it matters that it's dark if I'm blindfold): Make sure that if you have any testing related pods or libraries, that they are not included in the target you use for deployment. Calabash for example probably does make use of private APIs to get work done that'd not be possible otherwise, but it's not meant to be on the app you release.
We experienced the same error. Calabash is referencing LSApplicationWorkspace. After excluding references to Calabash for release builds, the app was not rejected from review any longer.

iTunesConnect app has one or more issues - Non-public API usage

I received the below email shortly after I submit my app to the AppStore from XCode Organizer. My app contains the framework in this GitHub (https://github.com/wujianguo/iOSAppsInfo), I use it to create shortcuts to the rest of the users installed applications, and ONLY for that purpose.
Is there a different way of getting a list of all installed apps so I can create shortcuts or will all methods be instantly rejected as below?
Dear developer,
We have discovered one or more issues with your recent delivery "shortcut-app". To process your delivery, the following issues must be corrected:
Non-public API usage:
The app references non-public selectors in Xxxx xxxx: _applicationIconImageForBundleIdentifier:format:scale:, allInstalledApplications, appTags, applicationProxyForIdentifier:, localizedShortName, openApplicationWithBundleID:
If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed.
If you think this message was sent in error and that you have only used Apple-published APIs in accordance with the guidelines, send the app's nine-digit Apple ID, along with detailed information about why you believe the above APIs were incorrectly flagged, to appreview#apple.com. For further information, visit the Technical Support Information page.
Once these issues have been corrected, you can then redeliver the corrected binary.
Regards,
The App Store team
This library uses private API which you cannot use especially when you submit the app to apple, as they will reject it like this.
I am not aware of another way to get installed apps, but in order for apple to accept uploading the app, you must stop using this library, specially this method.

Can i use "com.apple.springboard.lockcomplete" notification?

I am trying to find device lock state as UIApplicationState gives the wrong state when Lock the device, it gives UIApplicationStateActive for few second.
I found one solution using Darwin notifications for notification "com.apple.springboard.lockcomplete".
Is it the correct way to get Lock state? Does Apple allow this?
No Apple won't allow to use "com.apple.springboard.lockcomplete".My application get rejected due to this.
The answer is... it depends.
Using non-public API is not permitted, and these Darwin notifications are not publicly documented. So the official answer is no, you are not allowed to use this notification in a production code. Otherwise, you risk getting this unpleasant email from Apple:
Your app uses or references the following non-public APIs:
com.apple.springboard.lockcomplete
On the other hand, I've used that very notification for 4 years till I got a rejection from the App Store for one of my apps. Another app of mine still uses it without problems. So if you really need it and you think it's worth the risk, you may give it a try.
Based on our experience, your app WILL be rejected for use of com.apple.springboard.lockcomplete with the following notification:
Guideline 2.5.1 - Performance - Software Requirements
Your app uses or references the following non-public APIs:
com.apple.springboard.lockcomplete
The use of non-public APIs is not permitted on the App Store because
it can lead to a poor user experience should these APIs change.
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.
Next Steps
If you are using third-party libraries, please update to the most
recent version of those libraries. If you do not have access to the
libraries' source, you may be able to search the compiled binary using
the "strings" or "otool" command line tools. The "strings" tool can
output a list of the methods that the library calls and "otool -ov"
will output the Objective-C class structures and their defined
methods. These tools can help you narrow down where the problematic
code resides. You could also use the "nm" tool to verify if any
third-party libraries are calling these APIs.
Resources
If there are no alternatives for providing the functionality your app
requires, you can file an enhancement request.
Apple won't allow this.Here is there comments for this
"The use of non-public APIs is not permitted on the App Store because it can lead to a poor user experience should these APIs change.
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."

Card.io cause Non-public API usage

I got some trouble when I try to upload my app to AppStore.
Apple reject the app with these error message:
Non-public API usage:
The app references non-public selectors in MyAppiOS: cardNumber, cardType, libraryVersion, navigationBarStyle, navigationBarTintColor, preload, setCardNumber:, setNavigationBarTintColor:
Deep searching told me that the Card.IO is causing the problem, indeed it has all the above selectors.
The same code was uploading successfully. What can be the cause of such behavior?
The same code was uploading successfully. What can be the cause of such behavior?
Apple is continuously updating the checks they do on submitted applications. This means that re-submitting a new version, even with a trivial change, can sometimes end up rejected because of the new checks.
Your best bet is to ensure you're using the latest version of the library. An update might already be available for you - unless you're in the first people affected. In the later case you should file an issue with the developer or, since it's open source, re-compile a version of the library that excludes those symbols.

The app references non-public selectors in :setRefreshInterval

When trying to upload an iOS app for the appstore I am getting an error stating that
The app references non-public selectors in :setRefreshInterval
I am using a lot of libraries in my project from different Ad Network SDKs to three20, upon investigation I found out that the static library FlurryAds.a contains these methods and may cause an app rejection.
I have the latest Flurry SDK installed in fact I just downloaded it last night.
I asked one of my friends who recently integrated flurry ads that he got the same error but his app went through.
And now my question is did anyone else got this error while uploading the app to the appstore & if they did, were their app rejected?
For now I will be disabling FlurryAds but I will forward to your suggestions / pointers.
This warning is shown as a result of Flurry calling setRefreshInterval in two different mediated networks. Flurry is not calling any Apple private APIs. Many publishers have submitted with this, and since a private API is not called, there are no problems in submitting to the AppStore. (Full disclosure: I work in the Support team at Flurry)

Resources