Open mohammad-zr opened 2 years ago
I am also figuring out how to add an event when user navigate to another domain in the browser.
Inside AndroidManifest.xml put your activity like below:
<activity
android:name=".PurchaseActivity"
android:exported="true">
<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:host="in-app-payment"
android:scheme="test" />
</intent-filter>
</activity>
and in your web application use the below code:
window.location.href = ``test://in-app-payment:${productId}
;``
Inside your activity code (koltin, java) you could get params like productId (in my example) as shown below:
private fun purchaseProduct() {
val intent = intent
val uri: Uri? = intent.data
val productId = uri?.port.toString()
...
}
Is there anyway to catch url changed event in a twa? I want to do something when user navigated from our domain to a different domain...