【发布时间】:2018-08-10 09:29:13
【问题描述】:
我想通过点击我使用过的按钮打开新的 React 原生应用
在 React Native 中链接概念
React native Code : Test 是 Other App 的名称
Linking.openURL('Test://app');
还有在 android.manifest.xml 文件中添加 Intent 的 URL Andriod Intent
代码:Android.manifestfile.xml
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="com.Test" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="Test" android:host="app" />
</intent-filter>
</activity>
我该如何解决这个问题?
【问题讨论】:
-
我觉得好就好。实现此代码后您是否进行了构建。
-
是的,我已经完成了构建,但它给了我错误(在 react native 中找不到处理意图 act=android.intent.action.view 的活动)
-
我希望你有 react-native 应用程序。从A应用你要打开B应用。对在应用程序中使用此代码 Linking.openURL('Test://app');并在 B 应用程序更改代码:Android.manifestfile.xml 文件。对,请清楚..我说得对吗?
-
我只在 App A 中做这两件事
-
为什么?你想在自己点击打开相同的应用程序?
标签: javascript android reactjs react-native