App Can not request when luanch by NEHotspotHelper

Enter iOS system wifi page, app luanch by 'NEHotspotHelper', then request is ofen timeout.

but when app enter foreground, request is success.

What is the reason for this? Is there a restriction on the background of the system? What is the rule of restriction?

Answered by DTS Engineer in 240266022

Are you talking about a network request. If so, and that request is targeting the hotspot itself, make sure to bind the request to the hotspot interface via

-[NSMutableURLRequest bindToHotspotHelperCommand:]
.

Share and Enjoy

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

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

Are you talking about a network request. If so, and that request is targeting the hotspot itself, make sure to bind the request to the hotspot interface via

-[NSMutableURLRequest bindToHotspotHelperCommand:]
.

Share and Enjoy

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

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

If network request via socket, how to solve? Thanks!

If network request via socket, how to solve?

There’s no obvious way to do that. Most folks use NSURLSession to talk to their hotspot authentication subsystem, and that’s certainly what I recommend. Why do you need to use BSD Sockets for this? Does your hotspot vend a non-HTTP interface? Or are you trying to reuse some existing BSD Sockets code?

Share and Enjoy

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

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

when connect a unauthorized hotspot, network request is general fail, i want request via socket with pdp_ip0 to ensure success.

If the hotspot is still blocking outgoing requests, WWAN should still be the default route, in which case a standard NSURLSession request will go via WWAN.

Share and Enjoy

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

let myEmail = "eskimo" + "1" + "@apple.com"
App Can not request when luanch by NEHotspotHelper
 
 
Q