Open safari in same tab from iPhone application - iphone

I want to open a url link in safari from iPhone Application, but I need to open the url link in the same tab, not in New Tab as safari did.
I use the following code to open the URL:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://www.google.com"]];
But this code opens a new tab in safari each time it's invoked, is there any way to open the url link in same tab is safari?

Short answer : No.
Long answer : Unfortunately you won't have any ability to tweak how Safari will open a new page, and here's the reason is simple. If an app opens an URL in safari, and imagine the user would like to keep it (makes sense since he didn't close it) then opening a new url on the tab will be more likely to be user unfriendly from Apple.
The only way you will have the same tab opened on Safari is that if the 8 (max number) tabs are opened, then you url will indeed open on the 8th tab on safari even if it is already opened.

No, because that would remove the iOS devices owners last link. They could lose their link.
The only way you will have the same tab opened on Safari is that if the 8 (max number) tabs are opened, then you url will indeed open on the 8th tab on safari even if it is already opened.
There are free web browser tutorials out there, if you want more control, why not just create your own browser.
Creating a mobile-browser application tutorials:
2 part tutorial with web view here and here.
internet browser with a search bar video #youtube.com/.....

Related

How to open app from Puffin browser

I wish to play flash content in iPad app so i searched lot then finally i came to know Puffin browser will play flash content.
In my app when user tapping a button the app redirected to puffin browser then it will play the flash content. then again if try to re-open my app from puffin browser i could not re-open it.
I created URL Scheme for my app. after completion of flash video, i tried to open my app by using myApp:// in puffin browser but it does not re-open my app. if try same way in safari its working.
Please help me
External URL opening will be supported in the next version. Do you mean you want to manually type "MyApp://SomeUrl" in Puffin and then open MyApp with SomeUrl? Is your app free to download? I'd like to give it a trial.
ps: I work in CloudMosa which sells Puffin.
Maybe a bit late, but there a several documentated URL Schemes on the Puffin Developer Page: https://www.puffinbrowser.com/development/
Puffin Browser for iOS handles the following URL Schemes.
puffin for http
puffins for https
puffin-x-callback for callbacks back to calling app (iOS after version 3.5)
i.E. use instead of https://www.google.de the Url puffins://www.google.de to open https://www.google.de in the Puffin Browser.
Unfortunately currently workin only for the not longer maintained iOS Versions Puffin and Puffin Pro. The new browser Puffin Lite has afaik no documentated URL Schemes or does it?

Open and close url in safari using objective-c program

I have to open a URL in safari... and after doing some work on safari I have to close the safari...
my code is as below.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:strPageUrl]];
Actually I have to share video on myspace.. if user has shared the video then I have to close safari and need to activate my application again.
I want to do something similar facebook SDK login with safari..
Please help me how to open this
custom url schemes work only one way... Like if you opened safari from your application then you can't return back to your application unless the second application is also yours and you have implemented another custom url to return back to your application. Since safari was made by apple so it does not have info regarding your application.
I am not exactly sure what you are trying to achieve but you can try out UIWebView for requirement if it helps.

How to Link to a Website or Safari within my iOS app

I am using Xcode to develop an iOS app and I need to know how to link a website to a button to open with in the app. I want o have a drop down bar that has buttons to return to a separate screen and a button to save the link to another place. Is there a way to open a website or a link to safari with my app?
You can open a website directly by using a UIWebView object in your app.
You can get Safari to open a web site by invoking something like [[UIApplication sharedApplication] openURL:myURL].

How can I get the facebook user-agent string when click a link in Facebook app?

I have created a facebook application that is used for posting a message to the wall. The application works fine. In the message I post there is a link. When I use the iphone facebook app and click this link instead of having Safari open immediately, the url opens in an internal frame of the facebook app and by click the small arrow it has the on the right bottom I can choose 'Open in safari'. This happenes only in iphone.
Is there a way to make my links open directly yo Safari?
Or is there a way yo get at least the facebook user-agent string so as to have a special treatment for this case?
Thanks in advance

Add safari bookmark from iPhone app

I'd like to have my application be able to add bookmarks to safari programmatically, is this possible?
Not really possible : there's no API for that (and you can understand it from user perspective....).
An answer here confirms it :
Add bookmark to Safari on iPhone when an application is installed?
You can't add a bookmark in Safari itself, but you can add an icon on the user's Home screen that bookmarks an arbitrary URL:
User Experience Coding How-To's for Safari on iPhone