0
  • I am using chrome custom tabs to integrate a payment gateway inside an Android App. Inside the payment gateway I have have to provide payment_success_redirect url and payment_fail_redirect for fail.
  • Problem here is that whether payment succeeded or failed user is redirected to the given page. Now if user presses hardware back button previous page starts loading and I do not want this.
  • Is there a way to prevent this or know explicitly on which URL currently I am on.

My Code:

    try {
        CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
        CustomTabsIntent customTabsIntent = builder.build();
        customTabsIntent.intent.setData(Uri.parse(url));
        startActivityForResult(customTabsIntent.intent, CHROME_CUSTOM_TAB_REQUEST_CODE);
    } catch (Exception e) {
        e.printStackTrace();
    }
Sumit Shukla
  • 4,116
  • 5
  • 38
  • 57

1 Answers1

0

The API of Custom Tab component do not let the host app retrieve on which URL the user is right now, for privacy matters.

You can monitor only some navigation events as described here.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Cyril
  • 580
  • 2
  • 11
  • 23