10

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?

7vikram7
  • 2,764
  • 1
  • 25
  • 43
Zeeshan Shaikh
  • 103
  • 1
  • 7
  • Do you have any third party dependencies that might use a method named like this? – HAS Sep 09 '16 at 06:23
  • i am using facebook api and i don't know that fb is using this method name or not @HAS – Zeeshan Shaikh Sep 09 '16 at 06:26
  • That might be a problem, see https://github.com/googlevr/gvr-unity-sdk/issues/296 – HAS Sep 09 '16 at 06:28
  • @HAS i'm not using imageWithName anywhere in my project i have searched it instead of this method. + (UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize { UIGraphicsBeginImageContext( newSize ); [image drawInRect:CGRectMake(0,0,newSize.width,newSize.height)]; UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return newImage; } – Zeeshan Shaikh Sep 09 '16 at 06:41
  • You should appeal the result with Apple. It seems that they are picking up incorrect private API usage. – Paulw11 Sep 09 '16 at 06:56
  • @Paulw11 , How can a user test his/her application if it contains Private APIs. – Zeeshan Shaikh Sep 09 '16 at 07:08
  • @HAS How can a user test his/her application if it contains Private APIs. – Zeeshan Shaikh Sep 09 '16 at 07:08
  • 3
    Do you mean how can you know if it uses private APIs? Normally a programmer will know when they have used private APIs because you need to do so deliberately. Apple will also check your app when you submit. It seems at the moment Apple is getting false positives – Paulw11 Sep 09 '16 at 08:02
  • @Paulw11 yeah i know the APIs that i'm using but where is the error ? what things are missing or collide ? how can i resolve this problem ? please recommend something – Zeeshan Shaikh Sep 09 '16 at 10:19
  • Just got rejected this morning. We had a minor bug release and didn't add these methods Apple is complaining about now. Performance - 2.5.1 Your app uses or references the following non-public APIs: submit: switchView: – Pedro Sep 12 '16 at 16:56

5 Answers5

10

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:' *
JAL
  • 41,701
  • 23
  • 172
  • 300
4

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

Community
  • 1
  • 1
Qun Li
  • 1,256
  • 13
  • 13
1

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.

user2931321
  • 468
  • 1
  • 7
  • 28
1

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.

mariusu
  • 41
  • 1
  • I am also facing the same issue, got the below message from apple. Your app uses or references the following non-public APIs: 'ABLE.framework, _file' No where I am using this, kindly let me know how to findout in other libraries. My new version has got rejected because of this, but since my old version neither I added any new frameworks nor I updated the existing ones. – CKT May 22 '19 at 07:47
1

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

    grep -R 'setResult:' .
selva raj
  • 154
  • 5