ios: How to display “choose wireless connection” p

2019-03-29 07:17发布

问题:

If there is no internet connection and you start for example the safari app with Ipad or Iphone, a popup appears saying: "Choose wireless network"

Is there a way to force this popup to show up in my app when I want to?

The problem is, I have a button in my app which connects the user to facebook. After pressing the button the safari browser opens and shows the facebook authorization page. If there is no internet connection this popup appears, but there is no way to turn back to the app from there. So currently I check internet connection before allowing this authorization page to appear, but I also want to show this popup.

回答1:

It will show up automatically if your app tries to access internet-based resource and there's no wifi connection established but there is a wifi access point nearby.



回答2:

This dialog appears automatically if you have "Application uses Wi-Fi" set to YES in your ...-Info.plist and if there is no connection.



回答3:

This is not possible. The pop-up you have seen before is in Settings -> Wi-Fi -> Ask to Join Networks -> ON/OFF

Setting this to ON allows the OS to prompt the user to join a Wi-Fi network if it finds any in reach and you are not currently connected to one.

Apps cannot show this prompt, it's a system-level prompt.