Skip to content Skip to sidebar Skip to footer

How To Set A Url Scheme/link For A React-native App

I wanted to grant access to a react-native app using oauth for the spotify web api. I know I need to use linking to handle outgoing/incoming access to my app, but where can I speci

Solution 1:

To specify the URL scheme, modify your AndroidManifest.xml and add an additional intent-filter under the one provided by react native. Update yourscheme & yourhost with your values.

<activityandroid:name=".MainActivity"android:label="@string/app_name"android:screenOrientation="portrait"android:configChanges="keyboard|keyboardHidden|orientation|screenSize"><intent-filter><actionandroid:name="android.intent.action.MAIN" /><categoryandroid:name="android.intent.category.LAUNCHER" /></intent-filter><intent-filter><actionandroid:name="android.intent.action.VIEW" /><categoryandroid:name="android.intent.category.DEFAULT" /><categoryandroid:name="android.intent.category.BROWSABLE" /><dataandroid:scheme="yourscheme"android:host="yourhost" /></intent-filter></activity>

Solution 2:

Linking is different for each platform. For a cross platform approach I recommend to look into: http://applinks.org

See this link for instructions how to set this up on iOS and Android:

Post a Comment for "How To Set A Url Scheme/link For A React-native App"