Reputation: 442
I have setup deep linking in my app previously and had it work just fine. All the sudden it stops working. I have the below manifest...
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
android:screenOrientation="portrait"
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="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https"
android:host="www.giftwizit.com" />
</intent-filter>
<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="giftwi" android:host="Products" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
When I attempt to load https://www.giftwizit.com in a browser such as Chrome or even Samsung internet it simply loads up a google search page. The same happens when I attempt giftwi://Products.
What's interesting to me is when I run the adb command like...
all is good... the launcher shows up and asks which app I'd like to open the link with.
Now I am using app-auth, and I know that it has me make this entry into the build.gradle file, but I've had this before and had everything work just fine.
This snippet is from within the defaultConfig inside the build.gradle file, and is how the react-native-app-auth documentation says it should be. I just thought I'd include this to be as transparent as possible.
Hoping to get some help on this. I have noticed at least one other post where some guy was having the same problem years ago, but it hasn't received any answers.
Upvotes: 2
Views: 1303
Reputation: 1374
The reason for not able to redirect while typing/pasting URL
in your browser is due to a bug in Chrome browser itself. but that turned out to be an functionality and adopted by some other browsers as well
You can check the bug here, and look at the status: WontFix (Closed).
Now the reason behind all this according to them,
If a user typing/pasting URL in browser then the user really want to go that URL, instead being redirected on a application
So your deep linking is working fine, best way to test it, share the link and then click on it
And also this always redirection really caused problem as well, when user was not able to go on the website due to redirection, you can also check a bug report here due to this always redirection, status is now Fixed (Closed) for it
Upvotes: 4