Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS App Rejected : non-public APIs

The same app has already been approved twice before but after some changes like set the image view and submitting the app again, Apple rejected my app for following errors:

Performance - 2.5.1

Your app uses or references the following non-public APIs:

setResult: nextStarIndex

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.

How can a user test his/her application if it contains Private API's?

I am not using setResult: and nextStarIndex code anywhere in my project so what should I do?

like image 605
Zeeshan Shaikh Avatar asked Sep 09 '16 06:09

Zeeshan Shaikh


5 Answers

Run otool on the excutable.

Go to the build directory:

AppName/build/AppName.build/Release-iphoneos/AppName.build/Objects-normal/armv6/

and run

strings AppName | grep ‘setResult' to know which framework used that particular method.

like image 59
user2931321 Avatar answered Oct 17 '22 03:10

user2931321


The last time I encountered this was because of a namespace collision between methods in my code and private methods in the Cocoa API. You can also use grep to find out exactly where you're using those selectors:

grep -R 'setResult:' *
like image 22
JAL Avatar answered Oct 17 '22 04:10

JAL


I had the same situation with you. Now, the app is ready for sale. I hope I will help you to solve that problem.

"Your app uses or references the following non-public APIs: cancelAction:, defaultInstance "

My solved Steps:

(1) grep -R 'defaultInstance' *

enter image description here the CrashReporterSDK matches so i remove it .

(2) grep -R 'cancelAction:' * it matches some project function names. I also resolve them.

(3) I suggest that before using "grep -R", you should remove the project's "build document files", so "grep -R" will give us more useful information.

finished

like image 4
Qun Li Avatar answered Oct 17 '22 03:10

Qun Li


If you don't find the reference by searching your project, the issue is most likeley in a compiled third party library. You can use "nm " to list symbols in compiled libraries.

One of my apps was rejected by the exact same cause. I updated my project with the latest Facebook SDK (at this time 4.15.1), and the app passed the review.

like image 1
mariusu Avatar answered Oct 17 '22 05:10

mariusu


If you need check in your application only go to your project directory path in terminal and try below command.

    grep -R 'setResult:' .
like image 1
selva raj Avatar answered Oct 17 '22 03:10

selva raj