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

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."

Related

How to remove the HomeKit API from within your binary

I received this rejection message from apple in the resolution center:
Guideline 2.5.1 - Performance - Software Requirements
Your app uses public APIs in an unapproved manner, which does not comply with guideline 2.5.1 of the App Store Review Guidelines.
Specifically, it would be appropriate to remove the HomeKit API from within your binary and resubmit your application for review.
Since there is no accurate way of predicting how an API may be modified and what effects those modifications may have, Apple does not permit unapproved uses of public APIs in App Store apps.
the app code I'm using is open sourced
https://github.com/SuperMarcus/NineAnimator
I need help on how to remove the HomeKit API from within the binary.
First remove it from the Signing and Capabilities:
Then try to run your code again.
If you where using a HomeKit API anywhere in code, Xcode will show you where it is.

Apple rejected my app because of non-public APIs springboard

I use Nativescript, my app was rejected by Apple many times by the issue below.
Can someone please help me.
Your app uses or references the following non-public APIs:
com.apple.springboard.hasblankedscreen
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.
Apple have accepted my app after I removed one of libraries.
In my case, I used a SDK from my supplier of bluetooth door. It is old version so it call non-public API. Thank you all anyway.

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.

App rejection issue 2.5.1: Apps that use non-public APIs will be rejected (Since iOS10)

we just got my rejection from Apple about some non-public API "contectId". The only thing I have done since I upgraded to the latest Xcode and Titanium SDK (Also with the newest macOS), this became a problem.
I know that there's steps here in the message, but is this an Titanium bug or something?
--
Hello,
Thank you for your resubmission.
Performance - 2.5.1
Your app still uses or references the following non-public APIs:
contextId
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.
Next Steps
Please revise your app to remove any non-public APIs. If you have defined methods in your source code with the same names as the above-mentioned APIs, we suggest altering your method names so that they no longer collide with Apple's private APIs to avoid your application being flagged in future submissions.
Additionally, 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
For information on the "nm" tool, please see the "nm tool" Xcode manual page.
If there are no alternatives for providing the functionality your app requires, you may wish to file an enhancement request.
If you have difficulty reproducing a reported issue, please try testing the workflow described in Technical Q&A QA1764: How to reproduce bugs reported against App Store submissions.
If you have code-level questions after utilizing the above resources, you may wish to consult with Apple Developer Technical Support. When the DTS engineer follows up with you, please be ready to provide:
- complete details of your rejection issue(s)
- screenshots
- steps to reproduce the issue(s)
- symbolicated crash logs - if your issue results in a crash log
Best regards,
App Store Review
Although it was not really a Titanium-issue than more an issue with Apple detecting false positives, this issue has just been fixed in Titanium 5.5.1.GA and later, thanks!
I've also had two App updates rejected due to this reason.
Over the same period I've had others approved.
One common item between the two App updates that were rejected is the use of the following property set in my project:
<property name="run-on-main-thread" type="bool">true</property>

Resources