0

I have an application which uses connection to server via Wifi. When starting the application, I check if Wifi is logged in; If it is not, then I call Safari to enter the Wifi credentials and connect to it.

After successfully logging in with Wifi, I would like to go back to the application, automatically (automatically means in the same fashion Safari appeared from the application). Is it possible?

apaderno
  • 28,547
  • 16
  • 75
  • 90
utsabiem
  • 920
  • 4
  • 10
  • 21

2 Answers2

1

No, once you yield your foreground status, you can't suddenly claim it back. However, this type of captive network logon is built into iOS 5 onwards (it will detect captive networks, and pop up a modal Safari sheet for logging in), so you needn't really bother with your own method (unless it's a special Wifi setup).

Adam Wright
  • 48,938
  • 12
  • 131
  • 152
  • 1
    +1 to Adam. Just a possible off the wall alternative; dont open the website with safari, push a new view or present a modal view controller to a UIWebView with the link, and then set a clause for say once they entered the credentials, dismiss modalviewcontroller, that would resign the view back to the previous view. Keeps them within the application, if thats possible with your app – Elmo Nov 22 '11 at 14:00
1

If your wifi login application supports a return URL, you can setup a URL for your application that will respond by reopening your application. I have done this with an iPhone IOS 5 device.

I setup my app's url by adding a URL Types Item to my ${app_name}-Info.plist.

Check this link to create the url item: how to register an app...

Here's a full answer

Community
  • 1
  • 1
Heather92065
  • 7,333
  • 6
  • 31
  • 39