Facebook iOS app not launching my app for Applinks enabled link - ios

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>

Related

Smart banner for safari doesn't show my app information on iOS, how to make it work?

I'm using the following meta tag to show a smart banner on the iOS safari browser to open and install the app, copied from apple guide to smartbanners:
<meta name="apple-itunes-app" content="app-id=6444793650">
this works for every app, except ours!
the app id is:6444793650
I guess since the app is fresh, apple's lazy crawlers couldn't find time to crawl it!

Facebook App Links for iPad-only App

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.

App Links not launched by Facebook App on iOS

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.

Is it possible to test ios smart app banner on an unpublished ios app?

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://

How to test Smart App Banner Urls on in Dev environment

I'm wondering if it's possible to test iOS 6's smart app banners' app-argument URL parameter on dev builds of an iOS app. It appears the Open option in the banner only appears if the application is downloaded from the App Store.
What worked for me was to download my application from the appstore, and then overwrite it using a build from XCode. This worked and allowed me to debug the smart banner feature using my current build. This won't work from the simulator, you need to use a device.
Just to be clear, you must overwrite it. You can't delete the appstore version, and then build from XCode.
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://
The following worked for me using an iOS 6 device, because it didn't work with iOS 8.
I installed the app from the AppStore and then overwrite it with a dev build using Xcode 6.
This is a hassle, but what we did is add some logging messages and submit the build for Apple review marked for manual release. When the app is approved, issue a promo code for the unreleased version. Redeem the promo and that will install the unreleased version of the app. Go to safari and hit your web page with the meta tags to display Smart App Banners. Should launch your app and pass the URL. Then look at the console for your log messages.

Resources