标签: deep-linking

Android深层链接自定义URI

我在清单中定义了以下内容:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.app.package">
...
    <activity
        android:name="app.myActivity"
        android:label="@string/app_name"
        android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />

            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                android:host="www.example.com"
                android:pathPrefix="/gizmos"
                android:scheme="http" />
            <!-- note that the leading "/" is required for pathPrefix-->
            <!-- Accepts URIs that begin with "example://gizmos”-->
            <data
                android:host="gizmos"
                android:scheme="example" />
        </intent-filter>
    </activity>
 ...
Run Code Online (Sandbox Code Playgroud)

我已经定义了我的onCreate():

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    Intent intent = getIntent();
    Uri data = intent.getData();
    if (data != null) {
        Log.d("URI",data.toString());            
    }
}
Run Code Online (Sandbox Code Playgroud)

这符合Android文档:Android Deep Linking

所以问题是:

如何测试URI深层链接?根据文档我运行的东西

adb shell …

android deep-linking adb

8
推荐指数
2
解决办法
6742
查看次数

Android Deeplinking无法使用多种方案

我坚持以下方案.我在中定义了以下深层链接意图过滤器AndroidManifest.xml

预期的行为是当我找到格式的URL http://?www.domain.com/a/blabla或者在SMS/eMail格式中存在链接时,domain/xyz系统应该触发我的活动.

案例#1:工作正常

    <activity
        android:name=".MYActivity">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                android:host="xyz"
                android:scheme="domain" />
        </intent-filter>
    </activity>
Run Code Online (Sandbox Code Playgroud)

案例#2:工作正常

     <activity
        android:name=".MYActivity">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
             <data
                android:scheme="http" 
                android:host="www.domain.com"
                android:pathPrefix="/a"
             />
        </intent-filter>
    </activity>
Run Code Online (Sandbox Code Playgroud)

案例#3:不工作

    <activity
        android:name=".MYActivity">
        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data
                android:host="xyz"
                android:scheme="domain" />
             <data
                android:scheme="http" 
                android:host="www.domain.com"
                android:pathPrefix="/a"
             />
        </intent-filter>
    </activity>
Run Code Online (Sandbox Code Playgroud)

任何建议/要点/帮助真的很感激

android deep-linking intentfilter android-manifest android-activity

7
推荐指数
3
解决办法
6959
查看次数

从Facebook网页视图中打开iOS深层链接已停止工作

突然间,我的应用程序的深层链接在Facebook网页视图中停止工作,但是当我在Safari中打开深层链接时(或者在Web视图中单击共享并选择Safari),它们工作正常.

我为我的资源和应用程序链接添加了所有必要的开放图形标记,如下所示:https://developers.facebook.com/docs/applinks/add-to-content

自Facebook新应用更新以来,有没有人经历过相同的行为?版本:(34.0.0.36.265)

如果我想离开Facebook,我会得到通常的提示,但点击它后没有任何反应,设备会保留在Facebook网页视图中.我检查了https://developers.facebook.com/tools/debug/og/object/上的刮刀信息,但没有报告错误.

以下是共享的URL /资源以及到深层链接的路由(服务器可能需要唤醒):https: //www.qonnect-it.com/mexx

有任何想法吗?

facebook deep-linking ios applinks

7
推荐指数
1
解决办法
1507
查看次数

App Links支持多个子域名

我一直在阅读支持Android应用程序链接的文档和我的应用程序支持的子网站工作的网站,但有太多的子域,它们是动态构建的.我想知道是否有一种方法可以支持许多子域而无需在intent-filter标记中指定所有子域.

以下是来自google的示例的链接:http://developer.android.com/training/app-links/index.html#request-verify 该示例位于支持应用程序链接多个子域位置.

我认为正则表达式可以工作,但显然在定义主机时不支持.我不想列出所有这些,因为这意味着必须在创建每个新子域的情况下推送新版本

<activity ...>
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="https" />
        <data android:host=".*.example.org" />
        <data android:pathPattern="/.*" />
    </intent-filter>
</activity>
Run Code Online (Sandbox Code Playgroud)

我宁愿不使用第三方库或服务..但任何适合您的建议将不胜感激,了解如何使这项工作.

subdomain android deep-linking intentfilter applinks

7
推荐指数
2
解决办法
3582
查看次数

WhatsApp与特定手机号码的深层链接

因此,我的一个朋友告诉我,他们一直在使用Facebook广告发布深层链接,以发送whatsapp消息,并通过whatsapp询问有关广告的信息。坏消息:这个朋友不是很精通技术,所以他所知道的就是这些。

现在,这个话题实际上引起了我的注意,所以我开始研究。不幸的是:官方文档指出whatsapp的url方案类似于:

    whatsapp://send?text=WHATEVER_YOU_WANT&abid=RECIPIENT_ADDRESSBOOK_ID
Run Code Online (Sandbox Code Playgroud)

现在:最大的问题是,abid(地址簿ID)是相对于每部电话的,并且仅遵循将每部电话添加到我们正在谈论的特定电话中的顺序。在这种情况下,我要发送消息的联系人是402。但是每个移动设备上的402都是任何其他人。不是你想成为的那个。

因此,我通过下载iMazing和sqlitebrowser并使用iMazing备份工具对iPhone进行备份,然后从上述备份中提取ChatStorage.sqlite并查看sql数据库来达到了预期。我发现每个联系人的确有一个名为ZCONTACTJID(NUMBERWITHOUT+@s.whatsapp.net)的电子邮件地址,另一个名为ZETAG(w:APPARENTLYRANDOMNUMBER;)。

你们中的任何人是否熟悉此类ID,或者是否有办法使深层链接对将消息发送到特定号码有用?

谢谢!

facebook ads deep-linking whatsapp deeplink

7
推荐指数
2
解决办法
1万
查看次数

Intent Filter with android:autoVerify ="true" - 从未在安装时验证,默认的应用程序链接不起作用

我用我的Android应用branch.io SDK,并希望让我的应用程序在Android上6支链的默认处理程序描述这里(安卓指南)和这里(Branch.io指南)

这是我在AndroidManifest.xml中的活动声明:

    <activity android:name="com.mypackage.MyActivity"
              android:launchMode="singleTask">
        <intent-filter tools:node="merge" android:autoVerify="true">
            <data android:scheme="@string/url_scheme" android:host="open"/>
            <data android:scheme="https"
                  android:host="@string/branch_io_host"
                  android:pathPrefix="@string/branch_io_path_prefix"/>
            <data android:scheme="http"
                  android:host="@string/branch_io_host"
                  android:pathPrefix="@string/branch_io_path_prefix"/>
            <action android:name="android.intent.action.VIEW"/>
            <category android:name="android.intent.category.DEFAULT"/>
            <category android:name="android.intent.category.BROWSABLE"/>
        </intent-filter>
    </activity>
Run Code Online (Sandbox Code Playgroud)

但是,当我在我的设备上安装构建时,当我点击具有正确主机和路径的链接时,我仍然会看到选择器对话框.阅读完这篇关于应用程序链接的广泛指南后,我相信这种情况正在发生,因为我的设备永远不会验证我的应用程序的意图过滤器.例如,当我从Play商店安装Twitter应用程序时,我在LogCat中看到这些消息:

03-24 15:04:27.231: D/IntentFilterVerificationReceiver(16965): Received ACTION_INTENT_FILTER_NEEDS_VERIFICATION.
03-24 15:04:27.248: I/IntentFilterIntentService(16965): Verifying IntentFilter. verificationId:2 scheme:"https" hosts:"twitter.com www.twitter.com ads.twitter.com" package:"com.twitter.android".
03-24 15:04:30.134: I/IntentFilterIntentService(16965): Verification 2 complete. Success:true. Failed hosts:.
Run Code Online (Sandbox Code Playgroud)

但是当我安装我的应用程序时,我没有看到这样的消息.我尝试了发布和调试版本,尝试将其上传到Play商店中的Alpha测试并从那里安装,结果相同.为什么Android不验证我的Intent过滤器?

android deep-linking branch.io

7
推荐指数
2
解决办法
6334
查看次数

Firebase动态链接始终返回CANCELED

我正在为我的应用使用动态链接.

我一步一步地按照教程,我可以通过点击Facebook上发布的链接打开应用程序.

但是当我调用getInvitation时,我总是将CANCELED作为AppInviteInvitationResult的状态.

    AppInvite.AppInviteApi.getInvitation(mGoogleApiClient, this, false).setResultCallback(
            new ResultCallback<AppInviteInvitationResult>() {
                @Override
                public void onResult(@NonNull AppInviteInvitationResult result) {
                    if (result.getStatus().isSuccess()) {
                        // Extract deep link from Intent
                        Intent intent = result.getInvitationIntent();
                        String deepLink = AppInviteReferral.getDeepLink(intent);

                        // [END_EXCLUDE]
                    } else {
                        Log.d("StartActivity", "getInvitation: no deep link found.");
                    }
                }
            });
Run Code Online (Sandbox Code Playgroud)

进入调试,我可以看到result.getStatus()返回CANCELED,但点击舔正确打开应用程序.

哪里我错了?

编辑:我正在使用的链接是:https://wft4z.app.goo.gl/? link = https://aqld.it/testlink/112972&al=aqld://test/about?params%3D17363&apn= com.project.mydeeplink

清单上的过滤器:

android deep-linking firebase firebase-dynamic-links

7
推荐指数
1
解决办法
948
查看次数

React Navigation:利用与Redux的深层链接

在React Navigation中,可以通过将uriPrefixprop 传递给顶级导航器,或者通过将{containerOptions: {URIPrefix: PREFIX}}第二个参数传递给内置导航器(例如StackNavigator)来利用深度链接.

当Redux与React Navigation集成时,顶级导航器将传递给navigationprop.

但是,在RN应用程序上同时启用Redux和深度链接时.uriPrefixnavigationprop都需要传递给顶级导航器,这会引发错误,

这个导航器有导航和容器道具,因此不清楚它是否应该拥有自己的状态.

const S1 = () => <View><Text>S1 text</Text></View>;
const S2 = () => <View><Text>S2 text</Text></View>;
const S3 = () => <View><Text>S3 text</Text></View>;

const AppNav = StackNavigator(
  {
    S1: {screen: S1, path: 's1'},
    S2: {screen: S2, path: 's2'},
    S3: {screen: S3, path: 's3'}
  }
);

@connect(state => ({nav: state.nav}))
class App extends Component {
  render() {
    const
      { dispatch, nav } …
Run Code Online (Sandbox Code Playgroud)

integration deep-linking react-native redux react-navigation

7
推荐指数
1
解决办法
2521
查看次数

Android Deep Links和App Links令人困惑

任何人都可以解释在现实生活中的例子之间有什么区别

应用链接 - https://developer.android.com/training/app-links/deep-linking.html

深层链接 - https://developer.android.com/training/app-links/index.html

应用索引 - https://developer.android.com/studio/write/app-link-indexing.html

在Android?

已经阅读了太多的帖子和文档,但仍然无法得到确切的要点.

据我所知,App链接适用于Android 6.0和Deep Links 4.2.但在表现方面,他们正在做类似的任务.

android deep-linking android-permissions android-app-indexing applinks

7
推荐指数
2
解决办法
1010
查看次数

如何在我的Cordova应用程序中创建android.json?

所以我有一个使用ionic-plugin-deeplinks插件的iOS/Android Ionic Cordova应用程序.当AndroidManifest.xml中包含此插件时,该插件无法正常工作:

<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:host="synapticforce.com" android:pathPrefix="/" android:scheme="https" />
    <data android:host=" " android:pathPrefix="/" android:scheme=" " />
    <data android:host=" " android:pathPrefix="/" android:scheme=" " />
    <data android:host=" " android:pathPrefix="/" android:scheme=" " />
    <data android:host=" " android:pathPrefix="/" android:scheme=" " />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

但当我把它放在它的位置它工作正常:

<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />
    <data android:scheme="yourekamobile" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)

但是,每当我ionic prepare将覆盖我的修复回到原来的无功能方式.我试图在config.xmlcordova和plugin.xml parent/plugins/ionic-plugin-deeplinks文件夹的父级别中更改某些东西,它仍然会覆盖原始的破碎方式.然后我进去parent/platforms/android/android.json并改变了原始版本编写的地方作为我的版本,它一直很好.

所以我很高兴它有效,但我的问题是为什么它有效?怎么android.json建?编辑该文件是正确的事情还是有什么东西从我应该编辑而不是?

android deep-linking cordova cordova-plugins

7
推荐指数
1
解决办法
332
查看次数