How do I manage end-of-call behaviour in Mobile Safari when page is bookmarked to desktop? - iphone

I have a HTML5 mobile web app that needs to provide links so that the user can make phone calls. Adding the link to make the phone call is easy:
Call me
However, managing the post call behaviour is not.
If I view the app inside Mobile Safari, and click on the link, I get taken to the Phone app to make the call. When the call ends, the iPhone returns to Mobile Safari, on the same page I was on previously (i.e., the page that initiated the call).
However, if I bookmark the same page to the desktop (so the user experience is closer to an "app"), and click on the same link, I am directed to the phone desktop at the completion of the call. This means I need to reload the mobile "app", and navigate back to where I was when I made the call.
Why is the behaviour different between the two? Is there any way to get the bookmarked app to return to the same context that initiated the call?

Just a complete guess, but what if the link is to a page that redirects to the "tel:" URL?

Have you tried target = _blank? Just a blind guess. :-)

Related

On Facebook is it possible to force an app to display as a page tab?

I have a Facebook app the currently consists of 3 elements - an App on Facebook, Mobile Web, and a Page Tab.
Currently if I use the app URL it detects whether I am on a mobile or not and directs me to either the app on Facebook or the mobile web site.
What I'd like it to do is always show the app in the context of the page tab. Is there anyway to force this?
I tried looking at whether I could use the page tab URL directly and have that redirect to the mobile but depending on how I've linked it either returns a 404 or just takes you to the Facebook page. I appreciate I could do my own mobile detection but I thought I'd check if I'm missing something in Facebook first.
I wrote an explanation of how to do this here: https://stackoverflow.com/questions/14434072/create-facebook-page-tab-and-publish-template-on-it/14455665#14455665
Hope this is what you are after!

How to relaunch an app like facebook-ios-sdk does?

Question:
I am actively looking in the source code on Github's facebook-ios-sdk project myself but I was wondering if anyone already knows how to relaunch an app that sent an iPhone user to Safari, such that the user can come back after some work has been finished?
Example:
When using facebook to login, the original app is relaunched after the facebook login page has authenticated the user.
Motivation:
I would like to be able to do the same for youtube videos without having to completely lose the user. I don't want to use the standard webview approach because I don't want to provide extra space to first let the video load for the user and then have the user click the play button. I want to skip the play button and its associated click entirely! Instead I want the user to be able to click on just an everyday regular iPhone button and be shown the video with the navigation for coming back to the app via relaunch.
You need your app to register a "custom URL scheme". Then get the callback in the remote web service to return a URL with that scheme. iOS will then launch your application.
More (somewhat old) info available here.
A list of common custom URL schems on iOS can be found here.
Generally, as part of the OAuth login process, you supply a callback URL as one of the paramaters. What this does, is tell the remote server (YouTube), that on successful authentication, redirect the user to the supplied URL. If YouTube supports this (does it support OAuth?) then on successful user login within safari, youtube will tell users safari to redirect to the supplied url. If this url is a "custom URL scheme" it will cause your app to relaunch and you can handle the situation from there.

Redirecting a user from a custom tab on Facebook if on a mobile device

I currently have a custom app on Facebook that works fine on desktop PC's (full version of Facebook). As you would know you can't access custom apps from mobile devices and it redirects you to the wall of the page.
Is there a way to redirect them to a mobile web app if they try to access the app from a mobile device? So that way when people share links to the app I can at least show them something.
I saw the Mobile Web URL option in my app but am unsure on how this will actually work.
You are referring to the "mobile tab access" Vitrue announced this week? :)
What they are doing is this (basically):
Create a special link to the tab (mydomain.com/tablink1 or something, NOT the ?sk=app_xxxx URL in the browser bar)
On that link they have code which does a conditional redirect
If it's a regular browser/device, redirect to the tab (?sk=app_xxxx)
If it's a mobile browser/device, redirect to an alternate mobile webpage with the same content as the tab (mydomain.com/mobilecontent1)
The redirect is not on the actual tab, since the mobile browsers will never get there. It has to be on a separate page.
So if they try to access the tab on a mobile device with the regular tab URL they will not get redirected. It only works if they go to the special redirect URL. Vitrue's application publishes that special redirect URL to the Page wall.
It works very well to make sure everything you post to your Wall (which mobile users can see) does not break, but it does not really provide a redirect for mobile users trying to get to your tab.
That's the best we can do right now though, until Facebook actually comes up with a mobile tab solution (bug filed here: https://developers.facebook.com/bugs/264010470314544)
Good luck!

Is it possible to show a Facebook app as a Page Tab on mobile devices?

For example, the following URL shows the app in a tab:
https://www.facebook.com/just.to.get.a.rep?sk=app_203403406338325
But when on a mobile device it redirects to the mobile site and does not show the tab or even have a link to it:
https://m.facebook.com/just.to.get.a.rep?sk=app_203403406338325
I even have the application tab set as the Default Landing Tab for this page, but cannot get the pap to show for the page. Is there another format we need to develop for the App to support mobile? Ideally we would like to show the tab on iPhone app and other mobile viewing.
If you're in control of the link the user clicks on to reach your fanpage/pagetab-combination, then try adding a GET parameter ref=ts
h++ps://www.facebook.com/just.to.get.a.rep?sk=app_203403406338325&ref=ts
Apparently this prevents the redirect to the mobile version of facebook.
There's not currently any way to see App-provided Page tabs on the m.facebook.com site
Mobile web apps are supported, but they're not tied to the Page and need to be manually linked-to or bookmarked, the tab functionality simply doesn't exist now.
Currently you can develop application functions such as app authorisation but sadly no, you can't display standard iFramed tab apps, I suspect this is because of slow 3G data speeds and the fact that Facebook wouldn't want the mobile experience being any slower than it already is (dependent on external hosting etc).
Many of my larger clients are begging for it. The only workaround I use is to build an external page with the same content used in the iFrame - then you can direct users to the tab or mobile users to an external link.
https://www.facebook.com/pagename/app_000000000000000?ref=page_internal
as of now ref=page_internal is working as a work around.
You can redirect Mobile users to a specific mobile website, and have desktop users redirected to your page tab app.
Detailed instructions for doing this are available here:
https://stackoverflow.com/a/15860533/121285

Can an iPhone app generate web clips?

The safari browser lets you add an icon to the home screen as a bookmark to whatever webpage you happen to be on. I would want to do that same thing, but in an app I develop. So basically, the user would launch the app, do a bunch of stuff and somewhere along the way, a web clip would be created and pushed to their home screen (with their consent of course). Is this possible, or is it a feature exclusive to the Safari browser? It seems like this sort of thing could be done, but it also seems like it could be viewed as spam and therefore a reason for Apple to reject the app outright. Is this sort of thing feasible? If so, I would be very thankful for a link on where I could read up on how to go about it.
It seems unlikely that the iOS app security sandbox would allow an app to directly add web pages to the home screen.
Best bet might be to upload the webpage to some site, and then launch Safari with a URL to the webpage on that site, after requesting that the user manually "clip" that site using Safari.