iPhone SDK 4.0 Captive Network Support - CNMarkPortalOnline and CNMarkPortalOffline - What to pass as an interface name parameter
Can anyone please help me use the two functions properly?
CNMarkPortalOnline and CNMarkPortalOffline
What needs to go as an input parameter to these functions? The documentation says it should be an interface name. I can't make any sense what this interface name could be. I have tried passing SSID of the WiFi hotspot as an in开发者_运维知识库terface name parameter to these set of functions but they always return false means the operation was not successful.
Please let me know more about this functions if anyone has used them.
Regards,
CNCopySupportedInterfaces() should be used instead of hard-coding "en0".
I've got the answer finally. The interface name should be en0 as this is the name of the interface created automatically when iPhone gets connected to the WiFi hotspot. If there are more than one WiFi Connections then the interface names could have been en0, en1, en2 and so on... but as iPhone has only one network interface available the interface name you need to pass will always be en0.
Hope this helps someone.
-Hardik
精彩评论