11 Replies
      Latest reply on Jun 13, 2019 1:21 AM by eskimo
      Wei Lun Level 1 Level 1 (0 points)

        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?
        • Re: Binary Rejected because of using the "prefs:root=" for opening Wifi Settings
          NotMyName Level 4 Level 4 (865 points)

          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.



          • Re: Binary Rejected because of using the "prefs:root=" for opening Wifi Settings
            eskimo Apple Staff Apple Staff (11,805 points)

            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"

              • Re: Binary Rejected because of using the "prefs:root=" for opening Wifi Settings
                film-coder Level 1 Level 1 (0 points)

                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?

                  • Re: Binary Rejected because of using the "prefs:root=" for opening Wifi Settings
                    eskimo Apple Staff Apple Staff (11,805 points)

                    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"

                      • Re: Binary Rejected because of using the "prefs:root=" for opening Wifi Settings
                        gianlucafrompadova Level 1 Level 1 (0 points)

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

                    • Re: Binary Rejected because of using the "prefs:root=" for opening Wifi Settings
                      huyFMR Level 1 Level 1 (0 points)

                      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)