I am trying to use Facebook's new App Links metadata to cause the Facebook app to launch my native app on iOS. So far, it isn't working.
This is what I've done:
1 . I created a file called test.html with the following code:
<html>
<head>
<meta property="al:ios:url" content="MyAlScheme://test" />
<meta property="al:ios:app_store_id" content="123456" />
<meta property="al:ios:app_name" content="My App Name" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
</head>
<body>
<h1>Test</h1>
Launch App
</body>
</html>
(* 123456 and My App Name were replaced with the real app name and ID)
2 . In my XCode project, I registered the Scheme MyAlScheme in the app's plist. (Note: Proof that this scheme works is below).
3 . I sent a link to the aforementioned test.html to another user via Facebook Chat.
4 . I clicked on that link and the web page opened, though I am expecting the app to launch instead.
5 . With the web page opened, I clicked on the "Launch App" link. The app opens up (as expected), proving the the custom scheme is properly registered.
What am I missing?
Answering my own question:
It appears that this is a limitation, specifically, of the iOS Facebook Messenger app. It doesn't support App Links yet.
The same link, if accessed through the main iOS Facebook app (for example, if you post the link on the wall then click on it from the feed), works correctly: The Facebook app creates a special button on the status bar which allows you to open the link in the native app.
Currently, the way this works is that the webview is loaded immediately, but when an AppLink is detected, a native button is shown that allows the user to jump directly into the app. Things are being tweaked a little bit so you may see a slightly different user experience, but the general pattern should be immediate webview + native UI to jump straight into the app.
Related
I'm working on Facebook App Links for sharing content from my iPad-only app. The App Links work correctly on an iPad -- if the link is clicked on in the Facebook app, my app opens directly, or redirects to the App Store.
However, when clicking on the link from the iPhone Facebook app, it prompts the user to go to the App Store, which then does nothing, as there is no iPhone version of the App.
Is there a way to only have the App Link be active for iPad, and to fall back to the web version for iPhone?
Here are my app links tags:
<meta property="al:ipad:url" content="com.myapp://" />
<meta property="al:ipad:app_store_id" content="12345" />
<meta property="al:ipad:app_name" content="my app" />
<meta property="al:web:url" content="www.myapp.com/123" />
<meta property="al:web:should_fallback" content="false" />
This is not possible with App Links. The al:web:should_fallback property applies to all platforms — there is no way to set to only to iPhone/Android.
Additionally, setting al:web:should_fallback = true causes deep linking not to work on iOS, as you noted. This is a known issue with Facebook's implementation, and doesn't respect the official standards. It does work correctly in Android.
These are some of the reasons why we built Branch.io (full disclosure: I'm on the Branch team). You get far better device-level control, and don't need to worry about these edge cases.
I have added the following meta info in the head portion of my test web page.
<html>
<head>
<meta property="al:ios:url" content="schemeregisteredinapp://hereGoesTheURL" />
<meta property="al:ios:app_store_id" content="12345" />
<meta property="al:ios:app_name" content="Applinks Supporting App" />
</head>
<body>
<p>Opening a link to this page in Facebook iOS app should launch my "Applinks Supporting App".
</p>
</body>
</html>
I have added the custom url scheme schemeRegisteredInApp in my iOS app's info.plist. If I type a url of the format schemeRegisteredInApp://the/rest/of/the/path in iOS Safari browser, it successful launches my app.
But if I tap on a link to the webpage containing above mentioned HTML in Facebook app or Mailbox app (both are supposed to support applinks protocol) on iOS, the page just opens in a web view inside the Facebook app. My iOS app is never launched. I can't figure out what is going wrong. Applinks simply refuses to work as advertised. This is on iOS 8. Is Applinks broken?
Add the following to your website meta data and the Facebook iOS app will open your app directly.
<meta property="al:web:should_fallback" content="false" />
If that doesn't work then you still have other issues with your meta data. Best way to debug is to go to developers.facebook.com/tools/debug/og/object and type in your url and select 'Show existing scrape information'. If there are any errors it won't work. Fix the problems and hit the 'Fetch new scrape information' button. Then kill the Facebook iOS app and relaunch it. Then the AppLink will work as expected next time you press the item in the FB feed.
I tested on iOS 7. Before I updated to the latest Facebook app, I can see a popup at the bottom of the Facebook browser which leads me to my own app. Right after I updated the Facebook app to latest version, the popup doesn't show anymore. Same doesn't work on iOS 8. Maybe a bug in newest Facebook version. Hope to see they fix it or find a workaround.
I just checked the example you provided. For me it correctly shows a popup to install your app, but when installed it doesn't recognise it as being installed.
I inspected your app's plist and it seems that you haven't registered the URLSchema there. That is needed for Applinks to check if the app is installed or not.
Can you test this with a project where you have defined the Appschema in your app's plist?
If you want that link works in optional way when it launches app or open web page if app is not installed you need to add following meta-tag:
<pre>
<meta property="fb:app_id" content="[facebook app id]" />
</pre>
It does matter whether facebook app id exists or not. It will work properly in iOS only if it is exists. However Facebook on Android will open web view first still but allow to launch app from this page.
Following meta tag must be removed:
<pre>
<meta property="al:web:should_fallback" content="..." />
</pre>
We have an https webapp using an html cache manifest so it can run offline.
We instruct our users to add it to the homescreen for the best experience (no address bar on phones, etc etc). We have an issue where if you remove the app from the homescreen, close safari and then re-open and re-add to homescreen, the app will not use the app icon and cannot complete https requests and is missing some cached data.
The app will continue to always work great in safari itself, all resources are cached and loaded, and all https requests work fine.
Here are the steps to reproduce this, we have done it on an iOS 7 iPhone, iOS 8 iPhone, and an iOS 7 iPad2. This may work for other webapps making https requests and using cache manifests, but I'm not sure. This reproduces with a real cert as well as a self-signed cert.
Steps to Break the Webapp
Go to the homescreen
Tap and hold on the Webapp App Icon
Tap the little x that appears to delete the app from the homescreen
Tap the home button to close the edit mode
Double-tap the home button
Swipe up on ALL open apps (Safari and Webapp if open)
Re-open Safari (should reload the webapp)
Tap the share button and add to homescreen. (Should NOT show logo)
Open the app from the homescreen and attempt to deploy
Steps to FIX the webapp
If the Webapp exists on the homescreen, do the following:
Tap and hold on the webapp icon
Tap the x that appears to delete it
Tap the home button to close edit mode
Open Settings->Safari
Tap Clear History
Tap Clear Cookies and Data
Open Safari, type in https://OurWebappURL
Tap the share button and add the app to the homescreen (Should show logo and “AppTitle”)
Open the app from the homescreen and deploy
Here is the chunk of the html <head> tag that tells it to run as a webapp and use an app icon (it's cross-platform).
<html lang="en" manifest="cache.manifest">
<head>
<title>Our App Title</title>
<!-- Enable the homescreen app on mobile devices -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<!-- Enable the App Icon -->
<link rel="icon" type="image/png" sizes="196x196" href="images/AppIcon.png">
<link rel="apple-touch-icon" href="images/AppIcon.png">
<link rel="apple-touch-startup-image" href="https://ourURL/images/iPhoneStartup.png">
<meta name="viewport" content="width=device-width" />
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, height=device-height, width=device-width" />
<meta http-equiv="content-language" content="en">
If we remove the <meta name="apple-mobile-web-app-capable" content="yes" />, causing it to open safari and load the app there, it works fine, as it's just running inside safari. However, this is not the experience we want, so it is a workaround, not a solution. This also doesn't fix the issue of adding to homescreen the second time, the logo is still not used.
We're not registered as apple developers so I can't log a bug report. Please chime in with any ideas or feedback, this is a very tough one!
EDIT: I've now tested this with an http (no SSL) version of the same application and it works fine, this appears to be an https issue.
We determined that the cause of this is having a wildcard cert that has an incomplete certificate chain, or by using a self-signed cert.
Fully signed single-domain certs work great most of the time, and we're recommending that to our clients, but it appears that you can repair cert chains by contacting your cert provider and requesting the intermediate certs to install.
We did not do that in this case, we went to a single-domain cert with a shorter chain, as far as I can tell.
I have to test the smart app banners in an application, which is still in development, especially passing some 'app-argument' to this app.
The application exists on iTunes Connect, and his status is of course still "Prepare for Upload".
The banner is on my website's home page. But when I try to reach this page with my iPhone (Safari), the banner shows up, totally empty, and disappears after about 1 second...
Here is the banner code on my website:
<meta content="app-id=myAppId, app-argument=myScheme://123456" name="apple-itunes-app">
Is it possible to test this smart app banners before publishing the applications on the store?
The answer is sadly, no. You must first publish your app before the smart app banner will work.
But you CAN test Universal Links without a published app. You just have to have Apple crawl your website after you set it up.
https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html
As of now, Xcode 8 and iOS 10, I have tried all the methods but Cannot Debug the smart banners URL that is being opened, as it needs the store versions of the application.
I have found a workaround of this, and have tested my application using this.
Apart from the <meta ...> tag I have also added a link button on the page that uses the scheme to open the app.
<!doctype html>
<html>
<head>
<meta name="apple-itunes-app" content="app-id=xxxx,pt=xxxxx,ct=xxxxx,app-argument=myappscheme://www.mymobilesite.com/link/detailpage?query=x">
<title>Banner Debug Sample</title>
</head>
<body>
<p>Visit App Using Scheme.</p>
</body>
</html>
With this link I can debug the Dev builds and works well.
Though this only works when the app has registered a scheme for itself, but just for testing we can register a dummy scheme say appscheme:// and replace http:// scheme with dummy scheme, test it, and then revert links from app scheme:// to http://
I have a mobile-optimized website with the necessary code to it available as a webapp. This site includes links to place calls and send emails. This has worked for years on iOS. However, it no longer works on iOS 7. Here's a stripped down version of the code. I verified that after "adding to homescreen", opening the webapp, and tapping the phone number, it works in iOS 6 but not iOS 7.
<html>
<head>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
</head>
<body>
(212) 555-5555
</body>
</html>
Is this a bug in iOS 7? Or do I need to add something new for it to work in iOS 7?
When I look at the RFC's (# 2806, which defines the "tel:" URL scheme), I never see parenthesis characters in the example URL's.
And in the "Phone Links" example in Apple's URL Scheme Reference, Apple shows how they use HTML that looks like: "1-408-555-5555".
My guess is that - as of iOS 7 - Apple has tightened up a bit on how "tel:" URL's can be defined (e.g. parenths might require escaping or proper encoding).
So try getting rid of the parenths and see if you have better luck.
IOS7 can not link from webapps, you can't open URL's, App Store, Youtube either.
So it's not a "tel:" issue :-)
But they do work if you remove:
And make it just a home screen bookmark, not a webapp.
Mac