Force captive portal display

Hello,


I develop an app where user has to be connected to a specifically Wi-Fi network to get content. So, I use NetworkExtension to specify wifi network where I want to be connected and ask connection to the user from the app with NEHotspotConfiguration and NEHotspotConfigurationManager.


This Wi-Fi network should show a captive portal when the user is connected but it's only show when user goes to ios settings -> wifi. It's not showing directly from the app. Is there a solution for that ?


Thanks !

iOS has the notion of a Wi-Fi app, and some events (like showing the Wi-Fi picker when you have Ask to Join Networks enabled) are triggered when a Wi-Fi app is brought to the front. In this context Settings > Wi-Fi is treated like a Wi-Fi app. I suspect you’ll find that you’ll also see the captive network UI if you bring Safari to the front.

There’s no API that causes the system to act like this event occurred. One thing worth trying is to set

UIRequiresPersistentWiFi
. This makes your app a Wi-Fi app, and the fact that your app is at the front might be enough to trigger the captive network UI.

Share and Enjoy

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

let myEmail = "eskimo" + "1" + "@apple.com"
Force captive portal display
 
 
Q