How can I get the app link data if my app wasn't installed when the user tapped a deep link in the facebook app? There is surprisingly little documentation from facebook on this issue.
I have a deep link https://fb.me/635533123230265
Which returns the HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>App Link</title>
<meta property="fb:app_id" content="619350481515196">
<meta property="al:android:url" content="instapanel://panel?utm_source=fb&utm_medium=cpi&utm_term=sf&utm_campaign=PROPE">
<meta property="al:android:package" content="com.instapanel.android">
<meta property="al:android:app_name" content="Instapanel">
<meta property="al:web:should_fallback" content="false">
<meta http-equiv="refresh" content="0;url=http://play.google.com/store/apps/details?id=com.instapanel.android">
</head>
<body>Redirecting...</body>
</html>
If the app is already installed, AppLinkData appLinkData = AppLinkData.createFromActivity(activity);
works perfectly.
But if the app was not installed, I believe I'm supposed to use AppLinkData.fetchDeferredAppLinkData
. I can verify that within the facebook SDK it makes an HTTP request and receives JSON, but it never contains the deep link, just {"success":true}
. Any ideas?
Here is my code:
// Fetch data immediately.
AppLinkData appLinkData = AppLinkData.createFromActivity(activity);
App.setAppLinkData(appLinkData); // Handles appLinkData
// In case data is deferred because app wasn't installed yet.
AppLinkData.fetchDeferredAppLinkData(activity, new AppLinkData.CompletionHandler() {
@Override
public void onDeferredAppLinkDataFetched(AppLinkData appLinkData) {
App.setAppLinkData(appLinkData); // Handles appLinkData. appLinkData is always null here.
}
});