Coder Social home page Coder Social logo

Comments (6)

jpage4500 avatar jpage4500 commented on June 9, 2024

I should have mentioned that the card scanning feature had worked just fine previously with older versions of the drop-down UI library

from braintree-android-drop-in.

lkorth avatar lkorth commented on June 9, 2024

The README does point to using compile 'io.card:android-sdk:[5.5.0,6.0.0)', mainly because it has been tested and 5.4.x lacked support for quite a few phones due to a processor architecture issue.

That said, I don't see any reason why it shouldn't work with older versions of card.io. Drop-in does not actually depend on card.io or directly interact with it at all, https://github.com/braintree/android-card-form handles the interaction with card.io so it may have happened in android-card-form 3.0.3 or 3.0.4.

If you run:

new CardForm(context).isCardScanningAvailable();

in your app, does it return true, or false? Are there any card.io lines in your logcat?

from braintree-android-drop-in.

jpage4500 avatar jpage4500 commented on June 9, 2024

I can try this and report back.

In the meantime, we did go back to using drop-in library version 3.0.5 and the scan card button is back.

compile 'com.braintreepayments.api:drop-in:3.0.5'

But, it would be nice to upgrade to the latest eventually. I also wish there was a good solution for the card.io library too but I'm pretty sure it's too large to include in our app as-is..

from braintree-android-drop-in.

jpage4500 avatar jpage4500 commented on June 9, 2024

sorry for the delay - I was wrong when I said going back to 3.0.5 fixed the issue. The scan button still isn't there and I think I know why. This log line turned me on to it:

W	card.io 	 - Error opening camera: java.lang.RuntimeException: Fail to connect to camera service

At some point in the last few months we updated our app to set the latest targetSdkVersion version which has the side-effect of requiring run-time permissions (https://developer.android.com/training/permissions/requesting.html)

So, devices running android 6.0+ won't grant permissions based on the AndroidManifest anymore but need to prompt the user. Older OS's should still work as they do today.

It might be a little awkward to fix this by prompting the user before we open the drop-in UI but I'll try that and see if it works. I suppose ideally the user would be prompted when the actually clicked on the 'scan card' button but I can see how that'd require some changes in the library.

from braintree-android-drop-in.

jpage4500 avatar jpage4500 commented on June 9, 2024

note - i confirmed the 'scan card' button shows up if camera permission is requested before showing the drop-down UI.. it is fairly weird though since we have to do it for everyone regardless if they want to actually scan a card.

from braintree-android-drop-in.

lkorth avatar lkorth commented on June 9, 2024

Thanks for reporting back with your findings!

That makes sense, card.io 5.1.0 was the first version to support runtime permissions and would be the minimum version to use if your target SDK version is 23+. Like you mentioned, the work around for this would be to request the camera permission before checking if card.io is supported and showing the scan icon. However that doesn't really work well with how runtime permissions are designed to be used right when a user wants to access a feature that requires the permission.

Unfortunately this issue has already been fixed in card.io 5.1.0 and newer so we will not be implementing a work around or change to braintree-android-drop-in or android-card-form to handle this case.

from braintree-android-drop-in.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.