Binary Rejected because of using the "prefs:root=" for opening Wifi Settings

Our App will open WiFi Setting for selecting the machine's SSID as below code.


if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"prefs:root=WIFI"]]) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=WIFI"]];
} else {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"App-Prefs:root=WIFI"]];
}


We had publish our app in App Store.

However, I get an app rejected by the App Store after updating my App.


//----------------------------------

From Apple

2. 5 Performance: Software Requirements

Guideline 2.5.1 - Performance - Software Requirements


Your app uses the "prefs:root=" non-public URL scheme, which is a private entity. 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


To resolve this issue, please revise your app to provide the associated functionality using public APIs or remove the functionality using the "prefs:root" or "App-Prefs:root" URL scheme.


If there are no alternatives for providing the functionality your app requires, you can file an enhancement request.

//----------------------------------

I don't know how to do now because we must open our WiFi setting for setting our WiFi.

Does anyone has any idea?

Why are you doing that--setting the wifi network?

Depending on what you're trying to do, there are other things that you are supposed to use instead. For instance...


From "Hotspot Network Subsystem Programming Guide"


The Hotspot Network Subsystem allows a Hotspot Helper application to participate in the process of classifying and authenticating to Wi-Fi hotspot networks. This programming guide is a companion to Apple’s NEHotspotHelper Class Reference, which describes the Hotspot Helper API.

To start, read this post, which covers this specific situation and offers some general advice on how you can determine whether it’s safe to use an Apple URL scheme.

Next, NotMyName suggested you take a look at

NEHotspotHelper
, which might help. Be aware, however, that this API has strict restrictions, both business and technical. You can learn more about these in this post.

Coming back to the big picture, it would help if you explained why you need to send the user to Settings > Wi-Fi. In the absence of such an explanation, my recommendation is that you look at QA1942 iOS Wi-Fi Management APIs, which describes the Wi-Fi management APIs available on iOS and their expected uses cases. You might find something there that works for you.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

I need this API.. Users of my app use a specific wifi network to access proprietary hardware behind it. iOS device have a habit of grabbing other known stronger network. At least recent iOS versions grab the last one used. But it would be nice to give the user a shortcut to the wifi settings from our apps, so they can select the proper network if the proper network is not the current network connected to. we used to be able to do that, and now we're getting rejected because it requires a private api.. Is there a public api to do so?

Is there a public api to do so?

No.

Did you look at QA1942? Given you description of the issue it seems like

NEHotspotConfigurationManager
would be a good fit for your requirements.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Dear Eskimo,


Our company app has been rejected too (when putting it in production) for the use of prefs:root to open system settings.


The user must have the ability to connect to a specific wifi network (in some cases there could be more of these networks).

Then, once connected, the user must use our app to interact with this network.


In all of our testflight builds we received no warnings and our field testers tested and approved the app.

Then, when everything was finished and we went in production, Apple rejected the app for the use of private api (prefs:root scheme).


We can't use "UIApplicationOpenSettingsURLString" because it opens app specific settings, not generic nor wifi ones.


Then after the rejection I've started to look at NEHotspotHelper and NEHotspotConfigurationManager (from your documentation here
https://developer.apple.com/library/archive/qa/qa1942/_index.html

but it looks like these api will not let me perform a wifi scan and then connect to a specific network.


So what's the correct way to do this?

I've read hundred of posts here and on other dev forums but none of them have a "good" solution.


I dont want to show a popup telling the user to go to wifi settings and connect to the selected network, it will totaly ruin the app user experience.


Looks like Apple is trying to make programmers life harder and harder...

it looks like these api will not let me perform a wifi scan and then connect to a specific network.

Correct. QA1942 is pretty clear about this, when it says iOS does not have a general-purpose API for Wi-Fi scanning and configuration. How you proceed here depends on your specific situation. For example, folks doing accessory integration are often best served by implementing WAC.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Can you enlight us on how to implement this WAC?

Can you enlight us on how to implement this WAC?

Not really. The details of WAC are only available to MFi developers (and I don’t support MFi developers, so I’m not disclosed on them myself!). My understanding is that supporting WAC requires that your accessory be designed and built under the aegis of the MFi developer programme, but for details you’ll need to talk to the MFi folks.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi Eskimo,


My company implements the biometric support and we want to give users a short-cut to set up their touch/face id if they haven't done that. The only way I found is using "App-Prefs:root=TOUCHID_PASSCODE".

Will our app be rejected if we use this URL?


Hope to get your response soon!

Thank and Best Regards,

Huy Vu


P.S. looks like the URL only deep link to device root settings, cannot go to a specific setting. But still, is it allowed to use "App-Prefs" ? since "UIApplicationOpenSettingsURLString" will deep link to app settings (which does not have Touch/Face set up)

So the answer here is that if we want to deliver a good user experience setting up an IoT device, we have to pay apple for the MFi programm and redesign the device according to MFi?

WAC delivers the best possible setup experience for Wi-Fi accessories. If you’re not prepared to support WAC, you do have other options but they are not going to be as smooth as WAC. For example, if you have control over your accessory’s firmware can do something like this:

  1. Modify your accessory’s firmware to accept configuration commands over Bluetooth LE.

  2. In your app, ask the user for their home network’s SSID and credentials.

  3. Use Core Bluetooth to tell your accessory to join that network.

To simplify step 2, use Core Bluetooth to ask your accessory to scan for nearby Wi-Fi networks and return the SSID list to your app. Then present that list to the user, so that they don’t have to enter the SSID by hand.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi eskimo,

If prefs:root=WIFI scheme is not allowed, is UIApplicationOpenSettingsURLString OK?

Is the following statement a public API?

[[UIApplication sharedApplication] openURL: [NSURL URLWithString: UIApplicationOpenSettingsURLString]];


Thanks

Will our app be rejected if we use this URL?

I don’t work for Apple Review and thus can’t give definitive answers on their behalf. Earlier I talked about how to determine whether a specific URL scheme is supported or not (see this post), and I stand by that advice.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Binary Rejected because of using the "prefs:root=" for opening Wifi Settings
 
 
Q