I'm launching Chrome Custom Tabs using a similar function as below but I'm always getting the activity result as canceled which makes sense when clicking the close icon. but isn't really helping when I want to differentiate between a redirection to the app and the close icon click. is there a way to set the activity result for the custom tabs?
fun launchURL(context: Context, url: String, requestCode: Int) {
val builder = CustomTabsIntent.Builder()
val customTabsIntent = builder.build()
customTabsIntent.intent.data = Uri.parse(url)
(context as Activity).startActivityForResult(customTabsIntent.intent, requestCode)
}