Open link in browser or open app - iphone

I have made an iphone app. The app calls the webpage and displays the content. Server side coding is in php. The problem is I have several links in the webpage. When I click on the link in the webpage it opens the entire page and I am no longer able to go back to where I was.
I tried iframe but not all the website support it like google, facebook. What I am looking is someway to open the link in browser or launch the another app, like the app of facebook. I have quite thoroughly searched for the solution without much luck.
Any pointers would be greatly appreciated.
Thanks

To implement navigation for UIWebView you can do the following: create two buttons, one for going forward in history and one for going back. And here is the code for that buttons you must include:
//For going forward
if (yourWebView.canGoForward)
{
yourWebView.goForward();
}
//For going back
if (yourWebView.canGoBack)
{
yourWebView.goBack();
}

Related

(Freshplanet Facebook-ANE) How to make the login screen in-app

I am currently using the Freshplanet Facebook-ANE and was wondering about something that is bugging me currently.
I want to implement a simple post to wall feature inside my app, and this ANE does exactly what I want, except for one thing. When I do the actual post to wall dialog, it pops up just like I want it, in a WebView inside my app. The login takes me to Safari or the Facebook app if I have it installed, which is what I want to avoid.
Here's the line I'm using to open the session :
Facebook.getInstance().openSessionWithPublishPermissions(POST_PERMISSIONS, OnSessionOpened, true);
That works perfectly for posting, but takes me outside of the app.
I've tried using the same .dialog() function I use for the post, and it worked, but I can't seem to post to the wall afterwards (maybe I'm not correctly catching the access token or something)
Any help would be appreciated. I believe I've set up everything correctly on my Facebook App page, and that my AS3 project is correctly setup.
Thanks for the help !
If you want to strictly stay into the app, you must use StageWebView. It's something like a wrapper of HTML page inside Flash.
First check if you are logged in (this is code from Facebook.as of FreshPlanet):
/** True if a Facebook session is open, false otherwise. */
public function get isSessionOpen() : Boolean
{
if (!isSupported) return false;
return _context.call('isSessionOpen');
}
If there is no session - start the web view. Otherwise - continue as usual.
You have to keep in mind that StageWebView is pretty.. how to say it.. bad is the kindest thing I could say :) You must implement your own close button, listen for url changing, etc.
You could look into Facebook AS3 SDK, which at least has some kind of 'platform' for the web view..
Good luck!

Mobile form on website is not sending on the first click of "submit"

this is kind of a weird issue I'm having with a site's form when viewed on an iPhone5. When somebody fills in the information and tries hitting submit, it refreshes the page with all of the content still on the page but none of the tasks triggering. No errors or warnings are shown. When the user clicks submit again, the form works as intended.. so the first click doesn't seem to be working.
I don't own an iPhone5, but I tried this on both Safari and on my DROID4 (which both worked fine).
The site is built with DotNetNuke version 6, ASP.net, the forms are a module called DynamicForms, though I don't know if that information is needed.
Any help is greatly appreciated.
Your best bet would be to get in touch with the good folks at Data Springs, the creators of the Dynamic Forms module. They provide really good support.
I'm not sure what triggers you have, but that sounds like the browser for the device isn't actually doing the event. As for a potential work around, in your skin but this:
$(function () {
$(".SubmitButtonAnchor").click(function () {
if(window.confirm(location.href)) {
window.location = "http://bing.com";
}
});
});
The above example should anchor to your input button and do the following:
When you Submit it will prompt you of the page it is attempting to navigate to.
The ability to say "Yes" or "No".
Then navigate to the page.
This should bypass some issues you may be experiencing currently, I'd still let them know that it isn't working as intended.

Unable to open HTML href link in Safari/iPhone

I have created a simple application using Phonegap in XCode using HTML. My code looks like this:
<dd>Office Number</dd>
<dd>Personal Number</dd>
<dd>Log in to your Mail ID</dd>
The first two links are working fine. I am able to dial a number; but the last line is not working. It seems like disabled. In the mobile, after running, it's showing "Log in to your Mail ID" as a tab but nothing happens when I click it.The web address is not going to the Safari browser.
Please help. how can I integrate this link to Safari browser in iPhone like the first two lines.
Thanks in advance
u have to implement child browser in ur application......https://github.com/purplecabbage/phonegap-plugins/tree/master/iPhone/ChildBrowser
it have a option of opening the link in safari also .....if u have any query plz feel free to ask .....

titanium webview - go to default browser when clicking links

in titanium, i'm using the webview to display a wordpress blog page, that is already formatted for mobile browser. instead of writing my own interface, this works as a good work around. the apps sole focus isn't the browser.
but my issue lies, when the user clicks a link outside of the initial displayed domain. i only want the main domain to be displayed in the apps browser. if any other link is clicked, that takes the user outside of that domain, i want to have it open in the phones default browser.
can anyone point me in a direction for this. i tried adding a listener to try and catch link clicks, however, i've been unsuccessful.
thanks
in this blog posting I show how to find links in a webpage and change the link behavior. Using the same method, you can intercept the links and redirect to opening the URL in the devices default browser
One solution would be to catch the onclick() Event by Javascript inside the WebView (your blog code) and handle this by a custom handler. Maybe you can inject the javascript event handler code into the running WebView through Titanium.
Another solution is to make your blogposts readable for app technology and create a new data interface. This is the way I would do. For that I would use some kind of JSON data format and a simple REST Interface to get the data.
I don't think bove solutions are that simple. If you want an app with "great feeling", you'll have to handle the events by your own. Maybe Phonegap would be a better solution four your problem. But there you will still need a kind of REST/JSON interface for your blog data. The idea behind an app is, that the main code is in your app and you get the content from a remote source. This way you'll get an advantage compared to a simple browser optimized site.

How To stream.publish Within a Profile Tab

I have successfully setup an iFrame based App using the Javascript SDK, and we are trying to enable it on a Page Tab.
It seems Facebook has changed some things lately, because the app breaks when added to the Page Tab. I even went as far as making sure that all external scripts were included in the main index.php file, and that the body tags were taken out.
No, I'm trying to find out if it is even possible to use methods such as the stream.publish within a Profile Tab at all.
It seems like it isn't. As far as I can tell, you can no longer use any social methods on the Profile Tab.
Here were two related articles on the subject:
insidefacebook.com/2010/08/19/facebook-moving-toward-iframes-over-fbml-for-canvas-apps-and-page-tabs/
-and-
developers.facebook.com/roadmap
If anyone can confirm or deny this, it would be a huge help. The Facebook docs are just all over the place.
Here's a link to the working App Canvas as it stands now: http://apps.facebook.com/votetesting/
I know that on tab pages, you cannot do any JS until the user clicks on something first. Maybe that is the problem.
-Roozbeh