I am trying to implement an OAuth2 flow with an Android Chrome Custom Tab but my app is always closed (no crash) when the Chrome Custom Tab is receiving the 302 with the loc
It helped me to set the Activity that I use to start a CustomTab to singleInstance mode in the manifest file:
And in the code I do as usual:
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
final CustomTabsIntent customTabsIntent = builder.build();
customTabsIntent.intent.setPackage(someChromePackage);
customTabsIntent.launchUrl(singleInstanceModeActivity, someUriThatDoesRedirect);
I tried warming up Chrome and even calling customTabsIntent.launchUrl() with some delay after calling client.warmup(0l); and neither helped.