简体   繁体   English

如何在Facebook应用内消息中实现深层链接

[英]How to implement deep links on Facebook in-app messages

overflow community, 溢出社区,

We're developing deep-link functionality for an app, and came across a problem with the in-app messages functionality of facebook push messages. 我们正在为应用程序开发深层链接功能,并遇到了facebook推送消息的应用内消息功能的问题。

We're trying to send a deep link associated to a button of the in-app message, but when the users clicks such button, what the app does, is to open such url on the browser. 我们正在尝试发送与应用内消息按钮相关联的深层链接,但是当用户点击此类按钮时,该应用的功能是在浏览器上打开此类网址。

Facebook应用程序示例

What we need, is to be able to capture such action an parse the sent URL ( http://example.com/product?id=1234 ), however, we can't seem to find a way to do so. 我们需要的是能够捕获这样的动作并解析发送的URL( http://example.com/product?id=1234 ),但是,我们似乎无法找到这样做的方法。

We need to do this for iOS and Android, but as long as we can solve the problem for at least one platform, we could figure it out for the other. 我们需要为iOS和Android执行此操作,但只要我们能够解决至少一个平台的问题,我们就可以为另一个平台解决问题。

我相信你应该尝试实施Universal Links

You need to get Firebase Instance of Deeplink and parse Link manually like this than set your Dialog/button action to whatever. 您需要获取Deeplink的Firebase实例并手动解析链接,而不是将对话框/按钮操作设置为任何内容。

      FirebaseDynamicLinks.getInstance()
            .getDynamicLink(getIntent())
            .addOnSuccessListener(this, new OnSuccessListener<PendingDynamicLinkData>() {
                @Override
                public void onSuccess(PendingDynamicLinkData pendingDynamicLinkData) {
                    // Get deep link from result (may be null if no link is found)
                    Uri deepLink = null;
                    if (pendingDynamicLinkData != null) {
                        deepLink = pendingDynamicLinkData.getLink();
                        Log.d("DeepLink", deepLink.toString()+pendingDynamicLinkData.zzte().toString());

                        if(deepLink.getEncodedPath().contains("mobile-app")){

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM