Redirect User From Browser to My App after open a specific URL
- open the firebase app
- click on a dynamic link
- create your own redirect call back link on firebase like https://example.page.link/payment
- setup link on your manifest.xml file like following code
<intent-filter android:label="@string/app_name" android:autoVerify="true">
<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="example.page.link" android:path="/payment"/>
<data android:scheme="http"
android:host="example.page.link" android:path="/payment"/>
</intent-filter>
- run your app
- check the firebase link on android phone browser
- it's work yup
Try to open it like myapp://returnApp/?status=1
(add trailing slash character).
This is happens because path parameter is defined with default value of /
.
Unfortunately, you can't match exactly for empty string. As documentation states:
The path part of a URI which must begin with a /.
If you are really need to start app with exactly url myapp://returnApp?status=1
you can add android:pathPattern=".*"
parameter to your data clause like
<intent-filter>
...
<data android:host="returnApp" android:scheme="myapp" android:pathPattern=".*"></data>
</intent-filter>
Intent filter with data android:pathPattern=".*"
will match for any paths including empty one.