admin管理员组文章数量:1287523
I'm following this tutorial:
but my app doesn't lunched when I type this url at browser:
peopleapp://people/0
my manifest.xml
:
<manifest xmlns:android=""
package="*.*.*"
xmlns:tools="">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:largeHeap="true"
android:theme="@style/AppTheme"
android:supportsRtl="false"
android:screenOrientation="portrait"
tools:replace="android:supportsRtl">
<activity
android:name=".MainActivity"
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 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="peopleapp" android:host="people" />
</intent-filter>
</activity>
<activity android:name=".facebook.react.devsupport.DevSettingsActivity" />
<service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService">
<intent-filter>
<action android:name=".google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="io.invertase.firebase.messaging.RNFirebaseInstanceIdService">
<intent-filter>
<action android:name=".google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<meta-data
android:name=".google.firebase.messaging.default_notification_channel_id"
android:value="teamcide"/>
<meta-data
android:name=".google.android.geo.API_KEY"
android:value="AIzaSyDpiU78-****S6Lvllgqo"/>
</application>
</manifest>
I'm following this tutorial:
https://medium./react-native-training/deep-linking-your-react-native-app-d87c39a1ad5e
but my app doesn't lunched when I type this url at browser:
peopleapp://people/0
my manifest.xml
:
<manifest xmlns:android="http://schemas.android./apk/res/android"
package="*.*.*"
xmlns:tools="http://schemas.android./tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.READ_CONTACTS" />
<uses-permission android:name="android.permission.READ_PROFILE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:allowBackup="false"
android:largeHeap="true"
android:theme="@style/AppTheme"
android:supportsRtl="false"
android:screenOrientation="portrait"
tools:replace="android:supportsRtl">
<activity
android:name=".MainActivity"
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 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="peopleapp" android:host="people" />
</intent-filter>
</activity>
<activity android:name=".facebook.react.devsupport.DevSettingsActivity" />
<service android:name="io.invertase.firebase.messaging.RNFirebaseMessagingService">
<intent-filter>
<action android:name=".google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service android:name="io.invertase.firebase.messaging.RNFirebaseInstanceIdService">
<intent-filter>
<action android:name=".google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<meta-data
android:name=".google.firebase.messaging.default_notification_channel_id"
android:value="teamcide"/>
<meta-data
android:name=".google.android.geo.API_KEY"
android:value="AIzaSyDpiU78-****S6Lvllgqo"/>
</application>
</manifest>
Share
Improve this question
edited Mar 10, 2019 at 10:53
S.M_Emamian
asked Mar 10, 2019 at 10:04
S.M_EmamianS.M_Emamian
17.4k40 gold badges154 silver badges273 bronze badges
2 Answers
Reset to default 3There is a small quirk with Android and deep links and that is putting the link in your browser won't work. There are a couple of ways that you can open the link.
Tutorial
In the tutorial it says the following about opening it on an Android device:
That is all we need as far as configuration goes. To test this out, open Android Studio. Open Run -> Edit Configurations and change the launch options to URL, passing in the following url: peopleapp://people/1
App from the Play Store
You can use the following app to open your deep links https://play.google./store/apps/details?id=.manoj.dlt
Create a webpage
You can create a small webpage with your deep link contained inside an href
<a href="peopleapp://people/0">open people 0</a>
And then browse to that page and click your link.
Hii you can use following code to open specific url in react native
const url = 'whatsapp://';
Linking.canOpenURL(url)
.then(supported => {
if (!supported) {
console.log('Can\'t handle url: ' + url);
} else {
return Linking.openURL(url);
}
}).catch(err => console.error('An error occurred', err));
Or you can also check this url for more information
本文标签: javascriptHow to open app with an url specific react nativeStack Overflow
版权声明:本文标题:javascript - How to open app with an url specific react native - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741313001a2371755.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论