0

In my app, I call Safari to open (UIApplication delegate), Safari comes into foreground and there are some url redirections. At last, there's a url that I want to save in my main application.

How can I get this url and how can I return to my main app?

yuji
  • 16,695
  • 4
  • 63
  • 64
Kostas Papa
  • 5
  • 1
  • 4

2 Answers2

1

Short answer: You can't. Apple does not allow 3rd party applications to access any information about recent URL's visited in Safari and so on.

Emil
  • 7,220
  • 17
  • 76
  • 135
0

You can't, because Safari is now open and your app is now closed. In addition, the iPhone is sandboxed so you are probably not allowed to access Safari's information anyway.

Instead, I would recommend instead using a UIWebview. It allows the user to access the web from inside of your app. The current URL open in the UIWebView is located at myWebView.request.URL.absoluteString;

EDIT: This is not an example of multitasking. Your program can not run in the background unless it is making a VoIP call, checking location, or receiving push notifications.

dgund
  • 3,459
  • 4
  • 39
  • 64
  • I already did this with a UIWebView and i wanted to check multitasking features working with xcode.. – Kostas Papa Jan 07 '12 at 18:53
  • This is not an example of multitasking. Your program can not run in the background unless it is making a VoIP call, checking location, or receiving push notifications. – dgund Jan 07 '12 at 18:56