Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use StripeBrowserLauncherActivity when Chrome is available #3663

Merged
merged 2 commits into from
Apr 30, 2021

Conversation

mshafrir-stripe
Copy link
Collaborator

Summary

Previously, StripeBrowserLauncherActivity was only used when
the device had Custom Tabs support. Expand support to include
devices that don't have Custom Tabs but do have Chrome installed.

Rename CustomTabsCapabilities to BrowserCapabilitiesSupplier.

This PR adds a <queries /> entry for the Chrome package. This is
required by Android 11.

Motivation

Continue migration away from WebViews for browser-based authentication.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

Demonstration of behavior when Custom Tabs are not available and Chrome is installed:

Success Failure Cancel
success fail cancel

Previously, `StripeBrowserLauncherActivity` was only used when
the device had Custom Tabs support. Expand support to include
devices that don't have Custom Tabs but do have Chrome installed.

Rename `CustomTabsCapabilities` to `BrowserCapabilitiesSupplier`.

This PR adds a `<queries />` entry for the Chrome package. This is
required by Android 11.
-->
<queries>
<!--
Added to check if Chrome is installed for browser-based payment authentication (e.g. 3DS1).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The checking mechanism for custom tabs is a little different from the best practice described here:
https://developer.chrome.com/docs/android/custom-tabs/best-practices/#preparing-for-other-browsers

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm adding this for when Custom Tabs is not available.

You do bring up a good point though! We should verify behavior when multiple browsers support Custom Tabs.

@mshafrir-stripe mshafrir-stripe merged commit 2786b0c into master Apr 30, 2021
@mshafrir-stripe mshafrir-stripe deleted the stripe-browser-chrome branch April 30, 2021 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants