Comments (6)
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.
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.
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.
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.
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.
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)
- Can't Initialize Drop In Client HOT 16
- Layout and Inflate Errors HOT 12
- PayPal flow errors with UserCanceled error on returning to the Drop In. HOT 11
- Attempt to read from field 'java.lang.String com.cardinalcommerce.a.td.d' HOT 2
- Get reject by google play due to violation of User Data policy HOT 1
- AddCardFragment crashes upon device rotation with NullPointerException HOT 2
- Drop In wont able back to app HOT 10
- NullPointerException upon returning to app HOT 4
- Paypal payments end with 'User cancelled dropin' HOT 3
- Cardinal SDK configure Error HOT 2
- How set amount of money HOT 1
- Drop in probably stores payment data HOT 2
- Change Language Programmatically in braintree android dropin sdk HOT 3
- Google Play Console warning regarding com.braintreepayments.api:data-collector HOT 6
- Nonce is already consumed HOT 2
- Get Rejected by Google Play because of Violation of User Data, Permissions and APIs that Access Sensitive Information policy HOT 2
- Gradle wrapper jar not recognized by Gradle Wrapper Validation Action HOT 1
- Google is warning removal from Play Store because of Violation of User Data, Permissions and APIs that Access Sensitive Information policies HOT 16
- Upgrade braintree_android to 4.41.0 HOT 6
- UserCanceledException if the app is killed by the system while in background HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from braintree-android-drop-in.