Facebook Connect w/ Mobile Web App - How to get most fluid flow? - html

I'm developing a mobile wep app, and would like to allow my users to login using Facebook connect.
I initially implemented the standard Oauth2 authentication, but I found a couple issues:
When I install the app as a home screen shortcut and the user needs to authenticate the user is redirected to facebook's site for authentication in normal safari. When the user is redirected back, the user is still in safari (with the top and bottom nav bars). This is obviously sub-optimal as I'd like to have the full-screen appearance
I can't get logout to work properly, there appears to be a m_user cookie left on facebook.com that is the username of the user that was previously logged in.
I thought, perhaps, that I could switch to the javascript SDK for facebook connect and render a pop-over instead of the redirect dance, but it looks like this is a pop-up only experience. When I try it on the simulator it appears the home screen shortcut is broken out of to safari, and then after login the user isn't even logged in (and the screen remains blank).
Any ideas on the smoothest way of using Facebook connect on a mobile web (HTML5) app, especially if the homescreen shortcut is to be retained?
thanks!
-simon

Have you tried the latest Javascript SDK to accomplish this? https://developers.facebook.com/docs/reference/javascript/

Related

sms: and mailto: failure on iPhone Safari Mobile Browser

Problem:
Web page with sms: and mailto: links fail on ios mobile safari browser. A click on the link redirects you to:
Safari cannot open the page because it cannot redirect to locations
starting with "sms:"
or
Safari cannot open the page because it cannot redirect to locations
starting with "mailto:"
These used to work just fine up until around two or three months ago. Now these fail on Apple mobile devices using the Safari browser.
Background:
I create responsive web pages for activity based teams. One of the things we do is provide a team roster. The roster includes links for telephone numbers, SMS text pages and Email.
To keep things simple, we are using simple web pages.
Because of security and privacy concerns, this content is only served via ajax call via node.js server after login. We're using a single node.js Express server to host the website content and manage http/api calls.
Generally a click on the link pushes the mobile device into the appropriate native app for a phone call, SMS text message or email.
This has been working great for a couple of years, on all devices.
Lately we're seeing the problem on iPhones... but...
Here's the really weird part. I've got three teams using this technique.. The failure is only on TWO of the three teams. SMS link works just fine there.
The "tel:" link works fine on all devices.
The failures only occur on two of the three sites for sms: and mailto: on the iphone. Things still work just fine on Android devices, on Windows and on MacOS. The problem is Apple mobile devices.
The two sites that have the failures are Progressive Web Apps, with a manifest.json file and service_worker.js. The site that works fine has neither of those. When I remove the manifest, and turn off the service worker there is no improvement.
All three sites hosted via App engine at Google Cloud. The two sites that fail are only using web_app.appspot.com addressing. The site that functions well is using a real URL, pointing to the app engine location.
Typical Code:
<li>
<div class="userName">Jane Doe</div>
<div class="phoneNumber">321-555-1234</div>
<div class="sms"><img src="../images/crosstxt-icon.jpg"></div>
<div class="email"><img src="../images/email-icon.png"></div>
</li>
I wonder if this will show the issue, if you open this up in the browser of your Apple mobile device:
Click here to create a SMS message.
<br>
Click here to create an email message.
Apparently that's a fail. You don't even get to see the run snippet button on my mobile device.
Testing, more testing...
I just figured out... if I save the site to my mobile device homepage, such that an icon is added to home screen and in display mode, you can NOT see the top URL address bar, nor the Safari options bar on the bottom then the SMS: will fail. If you just open the address in Safari, but don't save the file, then it will work great.
Again, when I'm in Apple Web Application mode, the SMS link fails.
One hack... open the site via Safari mobile browser on the iphone. Save the site to Home Page. Verify the Icon is on the mobile phone. Go to Settings --> Safari --> Advanced --> Website Data, then Delete the site by sliding the content left. Cache storage is clean, but the Icon remains on the mobile screen. Use the Icon to aid in login, but don't save the site again. Note the URL line is visible. SMS will work.
Still testing here...
I tried to build a simple example to show the issue. I was totally unable to get the sample to fail with the error messages above. For reference the test site is here. The test source code is here.
I'm suspecting that the issue revolves around the fact that the two sites in question are both located at a subdomain site. (mywebapp.appspot.com) When the manifest includes all "valid" content the site does appear as a ios Apple Web app without visible URL line... but whenever I'm in that mode, SMS links are a total fail.
With that said, you can control the storage mode via <meta name="apple-mobile-web-app-capable" content="yes"> .
During my testing, I also noticed that whenever the manifest.json file contains // comment marks anywhere the file is ignored by Safari. Normally // comments are not allowed in a .json file, but according the MSN source, they are fine in a manifest.json file.
The choice is
a bit ugly and functional, or
pretty and non-functional
Currently I'm running <meta name="apple-mobile-web-app-capable" content="no">... I get the advantage of a custom icon on the home screen, even though the web app is still obviously inside a mobile browser with top/bottom info lines visible, sigh.

exporting .vcf contact in mobile web app capable aka HomeScreen app

I suspect this must be intentional on Apples part but I will ask anyway because it works from both mobile and desktop safari.
I create a simple .vcf contact from inside my web app and try to download (aka export) it.
This creates a .vcf file in desktop Safari that is actually downloaded where the user actually has to click that to get it into contacts. And in the mobile safari version (without saving to home screen), the exact same code will pop up a warning screen mobile .vcf warning which at least gives the user the opportunity to import the .vcf into contacts.
Admittedly neither the desktop or mobile safari use case it a good user experience but at least they work.
Whereas, the exact same code saved as a homescreen mobile app simply fails without error on an iphone (i.e
)
I have tried multiple ways to export from the app (most of which work from safari mobile or desktop browsers if NOT web app capable)
as a blob from base64 text/vcard
as base64 text/vcard
using window.open(vcftxt); // where vcftext is base64 text/vcard
using location.href = vcftxt; // where vcftext is base64 text/vcard
using an a tag with download= and href= vcftxt url
All the above work..just not in a homescreen app that appears native
code example (run on iphone safari...not tested on android)
https://www.airbridgelabs.com/s/0/app3.html?sd=100 - Click on contacts logo at the bottom when this page opens in safari and you will see the warning which still allows the user to open the .vcf in contacts
https://www.airbridgelabs.com/s/0/app3.html?sd=100&tm2=100 - This will walk you thru saving to home screen or you can simply save to home screen manually without the tm2 parm. click on the contacts logo at the bottom when this page opens in safari and you will see nothing. Safari developer remote console shows no errors or warnings...simply does not work.
I figure I can probably pass the created .vcf to a page on my server which in turn opens the .vcf which will likely then export it to mobile contacts..but that is a lame solution which still requires the user to be online to save an embedded contact.
And please don't use the argument that this is about security. If it was about security then you wouldn't be allowed to do the exact same thing from a desktop page, or mobile safari page or hybrid native app...and you can. This looks like Apple simply reducing the value of mobile web apps that look native.
What I am looking for is an offline work around to simply save a mobile contact already coded into the mobile web app capable content the user intentionally created.

HTML loader in AIR no longer correctly loads facebook authorization screen

I have a standalone Adobe AIR application which uses the HTMLloader to embed a webpage and thereby access the Facebook login.
When a user first uses the application thery are first presented with a FB login screen, and then a FB authorization screen, asking if the user wants to share the uploaded image with their friends.
Up until recently everything worked fine.
But it seems that facebook has changed the way the authorization popup displays so my htmlloader no longer can 'see it'. I get a blank page.
The application sees
But should see
Does anyone know of a workaround?
Answering my own question
Supplying an optional userAgent string when I first call login returns an older version of the permissions dialog which renders correctly

WebAuthenticationBroker in Win10 Tablet Mode

We're using the WebAuthenticationBroker to connect to OAuth providers such as Facebook, Flickr and Instagram in our Windows 10 UAP app. When the OS is in tablet mode, the header bar of the WebAuthenticationBroker dialog is hidden, leaving the user no way to cancel out of the dialog. Is there any way to force the header of the control to remain visible when in tablet mode? Or should the onus be on the Oauth provider to render a control on their authorization page that redirects to the callback URL provided when the broker was invoked?
UPDATE:
Microsoft has acknowledged this issue and have fixed this in the current Insider Fast Preview Build. They've added a back button to the WebAuthenticationBroker in tablet mode similar to the control on the desktop mode's interface. This will allow a user to dismiss the dialog if they choose not to authenticate or wish to cancel out of an error state.
By default, tablet mode is like the Mobile view, no title bar for dialogs (most cases).. and you can't customize the auth broker view :(
As a workaround, you can manually do it by a webview control if you really have to customize it.

Open link in mobile browser(safari) instead of Facebook native browser (html base)

Im developing a web with facebook share link function. I notice facebook mobile apps will open shared link in its own browser, instead of mobile broswer (IE. safari, chrome and so on). Is there any control on this able us to force facebook open the link in mobile browser?
No. The only reliable workaround is if you use the web app with an iOS app, and all users install that iOS app, you can send users to your iOS app to accomplish that task which isn't a great workaround.
An easier but still not optimal solution would be to detect the Facebook browser in the user-agent string, and display a message to prompt users to visit the URL in the mobile browser.