No matter what I do all browsers return false for useCustomTab
Set up Chrome as default browser com.android.chrome with version 69.0.3497.100 has browser.useCustomTab = false
Set up Firefox as default browser org.mozilla.firefox with version 62.0.3 has browser.useCustomTab = false
Looking at this data in the AuthorizationService constructor by setting a break point and inspecting the browser variable.
Tried to white list Chrome, Firefox and Samsung browser via AppAuthConfiguration but then it just gives activity not found exception in the console and program stops.
Run simple test of CustomTabsIntent.Builder().build().launchUrl(this, Uri.parse("https://www.cnn.com"))
This runs and uses a custom tab in the app without any issue so custom tabs are usable via code on the device using either browser.
App is built using androidx libraries 1.0.0, Kotlin version 1.2.71, supportLibVersion = '28.0.0'
It's caused by Jetifier. I wrote about it over here: https://github.com/openid/AppAuth-Android/issues/417#issuecomment-433111586
I moved all the library code into a module in my app. I then converted it all to use ANDROIDX format and swapped line 187 of BrowserSelector to
serviceIntent.setAction(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION);
And now all is working fine in my app. Conversion to ANDROIDX touches nearly every file in the project.
I moved all the library code into a module in my app. I then converted it all to use ANDROIDX format and swapped line 187 of BrowserSelector to
serviceIntent.setAction(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION);And now all is working fine in my app. Conversion to ANDROIDX touches nearly every file in the project.
Hi Kevin
Will you be able to post a link to with your solution with AndroidX? E.g. an aar file with the library..
I'm currently stuck with "Cannot change strategy of configuration ':app:compile' after it has been resolved" when trying to convert to AndroidX :(
porkyhead Would love to help you out. I currently just have this included as a module in my project so I don't build an aar file or create any sort of library out of it. If there is a good way for me to zip it up and put someplace for you I am totally willing to do that. Don't know the best way to connect. Maybe you can post your Reddit name, LinkedIn name, etc. and we can start contact that way.
Sounds great Kevin. You can find me on Reddit as "porkyhead".
@KevinPosim @porkyhead I downloaded the library code, upgraded it to use AndrodiX and made the change mentioned above. I imported the aar file in my test project. I made the following change.
private static boolean hasWarmupService(PackageManager pm, String packageName) {
Intent serviceIntent = new Intent();
serviceIntent.setAction(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION);
serviceIntent.setPackage(packageName);
return (pm.resolveService(serviceIntent, 0) != null);
}
Still, it has not helped me. I get the same issue again. usCustomTab returns false. Any more pointers as to what I can do to fix this custom tab issue? Thank you so much in advance.
It would be fantastic to add AndroidX support for custom tabs adapting the library like @KevinPosim did.
Is a release scheduled at all to include Android X support to fix the custom tabs issue?
Until we get a fixed version of Jetifyer, are you able to use: maven { url "https://dl.bintray.com/hnljp/AppAuth-Android" } '0.7.0-43-g8ce60dc' it is using this code: https://github.com/hnljp/AppAuth-Android/tree/JetifierCompatible
I was also facing the same issues, please refer this fix https://github.com/openid/AppAuth-Android/pull/438
@hnljp hello, are you still using this library? Could you please update your branch with the last version 0.7.1?
is JetifierCompatible in 0.7.1 yet?
Library is using androidX since 0.8.0 so this should no longer be an issue.