android - 应用程序链接不起作用。如何从网络浏览器打开应用程序?

标签 android react-native deep-linking react-native-linking

我已按照 android 文档中的步骤进行操作 Here在我的应用程序中实现链接。我真的不需要任何花哨的参数传递,我想要的只是当用户单击我的应用程序打开的浏览器上的链接时。我所做的只是修改我的 AndroidManifest。这是相关部分

<application
  android:name=".MainApplication"
  android:allowBackup="true"
  android:label="@string/app_name"
  android:icon="@mipmap/ic_launcher"
  android:theme="@style/AppTheme">
  <activity
    android:name=".MainActivity"
    android:label="@string/app_name"
    android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
    android:windowSoftInputMode="adjustResize"
    android:launchMode="singleTask">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>

    <intent-filter android:label="filter_react_native">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="u2player" android:host="open.my.app" />
    </intent-filter>


  </activity>

我正在使用 react-native-navigation 并尝试从 chrome 浏览器或 native 浏览器浏览到任何 u2player:// u2player://open.my.app u2player://open.my.app/ 不工作。我还绑定(bind)了来自链接模块的 url 事件,但没有任何效果。我重新启动,卸载等

感谢帮助

最佳答案

尝试使用 branch .它解决了您面临的大部分问题,并且它还有一个非常干净的文档。如果您有任何问题,请通过并告诉我

关于android - 应用程序链接不起作用。如何从网络浏览器打开应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48493895/

相关文章:

android - URL 解码器不工作

android - 如何在 Android 中获取前缀字符串值?

ios - 结合 rn-fbsdk 和 react native 链接 objective-c 代码

ios - React Native iOS 应用程序在使用 xcode 9.0 的 iOS 11.3 上崩溃 "EXC_BREAKPOINT (SIGTRAP)"

android - 为什么 android 深度链接使我在 Whatsapp 上的链接在 Whatsapp 的应用程序中打开?

php - 从 PHP 执行 Python 脚本

android - 如何将 youtube 视频 URL 传递给 android Studios 中的新 Activity ?

react-native - 如何在 React Native 中设置 canOverrideExistingModule=true?

android - 通过 Android 中的深层链接将额外值传递给 Intent

android - 如何深入链接到Android中的Amazon Shopping应用程序的产品页面?