如何获得Facebook应用程序链接,如果未安装应用程序 [英] How to get facebook app link if app wasn't installed

查看:2307
本文介绍了如何获得Facebook应用程序链接,如果未安装应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎样才能获得应用程序的链接数据,如果我的应用程序,当用户点击了Facebook应用程序一个深层链接是没有安装?有从Facebook在这个问题上出奇的小文件。

我有一个深层链接 https://fb.me/635533123230265

它返回的HTML:

 <!DOCTYPE HTML PUBLIC -  // W3C // DTD HTML 4.0过渡// ENhttp://www.w3.org/TR/REC-html40/ loose.dtd>
< HTML>
< HEAD>
< META HTTP-当量=内容类型内容=text / html的;字符集= UTF-8>
<冠军>应用链接< /标题>
<元属性=FB:APP_IDCONTENT =619350481515196>
<元属性=人:机器人:URL content="instapanel://panel?utm_source=fb&utm_medium=cpi&utm_term=sf&utm_campaign=PROPE">
<元属性=人:安卓包内容=com.instapanel.android>
<元属性=人:机器人:APP_NAMECONTENT =Instapanel>
<元属性=人:网址:should_fallbackCONTENT =假>
< META HTTP-当量=刷新内容=0; URL = HTTP://play.google.com/store/apps/details ID = com.instapanel.android>
< /头>
<身体GT;重定向...< /身体GT;
< / HTML>
 

如果已安装的应用程序, AppLinkData appLinkData = AppLinkData.createFromActivity(活动); 完美的作品

但是,如果未安装应用程序,我的相信的我应该使用 AppLinkData.fetchDeferredAppLinkData 。我可以确认的Facebook SDK它使一个HTTP请求和接收JSON之内,但它永远不会包含深层链接,只是 {成功:真} 。任何想法?

下面是我的code:

  //立即获取数据。
AppLinkData appLinkData = AppLinkData.createFromActivity(活动);
App.setAppLinkData(appLinkData); //把手appLinkData

//如果数据被推迟,因为应用程序是尚未安装。
AppLinkData.fetchDeferredAppLinkData(活动,新AppLinkData.CompletionHandler(){
    @覆盖
    公共无效onDeferredAppLinkDataFetched(AppLinkData appLinkData){
        App.setAppLinkData(appLinkData); //手柄appLinkData。 appLinkData总是空在这里。
    }
});
 

解决方案

看起来像FB现在已经修复了这个问题。

编辑:按照此设立递延深层链接:https://developers.facebook.com/docs/app-ads/deep-linking#deferred-deep-linking

该链接进行测试: https://developers.facebook.com/tool​​s/ APP-广告辅助/

进入应用程序广告帮手 - >选择您的应用程序 - >测试深层链接 - >进入深层链接URL - >检查发送推迟 - >发送到Android。

请注意:  1.你需要有FB的应用程序安装在设备上并登录到同一个开发者账号这个工作。  2.需要卸载并发送延迟后重新安装应用程序     深层链接。卸载可以在发送的链接以及前完成。

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&amp;utm_medium=cpi&amp;utm_term=sf&amp;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.
    }
});

解决方案

Looks like FB has fixed this issue now.

edit: Follow this for setting up deferred deep-linking: https://developers.facebook.com/docs/app-ads/deep-linking#deferred-deep-linking

This link for testing: https://developers.facebook.com/tools/app-ads-helper/

Go to App Ads Helper -> Select your App -> Test Deep Link -> Enter deep-link URL -> Check Send Deferred -> Send to Android.

Note: 1. You need to have FB app installed on your device and logged in to the same developer account for this to work. 2. Need to uninstall and reinstall the app after sending a deferred deep-link. Uninstall can be done before sending the link as well.

这篇关于如何获得Facebook应用程序链接,如果未安装应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆