Coder Social home page Coder Social logo

cardscan-ios's People

Contributors

awush-stripe avatar awushensky avatar dependabot[bot] avatar dulse avatar dxaen avatar igor-makarov avatar jaimejiyepark avatar jaimepark-stripe avatar justinvallely avatar kingst avatar kingst-stripe avatar li-andy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cardscan-ios's Issues

No such module 'CardScan'

In iOS after installing latest version pods, Its showing error "No such module 'CardScan'"
latest version is '2.0.3'
previous version '1.0.5032' was not showing the above error

Trial license

Hi.
Web portal for trial license doesn't work.
Can you check it please?
Thanks.

QUESTION / ENHANCEMENT: Deny certain fields from being scanned

Hello CardScan team,

I have the SDK up and running and it works well.

I am not sure if this is the right place to ask this, but right now when I scan the credit card, it scans all the relevant data as expected.

However, for my application, I only need the CC number. While I can handle that on the UI side of my app to show only the relevant fields, for a brief moment, on the Card Scanner Controller, it does show that the expiry was scanned as well which might make the user's wonder, why am I scanning this data if I do not need it.

So I was wondering if there was a way to specify what fields we were interested in scanning ?

Thanks in advance.

Error in declaring network.

Most of our users are getting a crash with this error. I can run it fine on my device, and my handful of testers can run the application just fine.

Fatal error: 'try!' expression unexpectedly raised an error: Error Domain=com.apple.CoreML Code=0 "Error in declaring network." UserInfo={NSLocalizedDescription=Error in declaring network.}: file [path to project]/Pods/CardScan/CardScan/Classes/Models.swift, line 274

Any help would be appreciated!

Issue with installation from SPM

Anyone else receiving this error?

failed downloading 'https://downloads.getbouncer.com/swift_package_manager/2.1.2/CardScan.xcframework.zip' which is required by binary target 'CardScan': downloadError("Error Domain=NSURLErrorDomain Code=-1003 \"A server with the specified hostname could not be found.\" UserInfo={_kCFStreamErrorCodeKey=8, NSUnderlyingError=0x600002c85650 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 \"(null)\" UserInfo={_NSURLErrorNWPathKey=satisfied (Path is satisfied), interface: en0[802.11], ipv4, dns, _kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <F0261A9C-03AA-40FD-B2A4-BAB38799C732>.<1>, _NSURLErrorRelatedURLSessionTaskErrorKey=(\n \"LocalDownloadTask <F0261A9C-03AA-40FD-B2A4-BAB38799C732>.<1>\"\n), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=https://downloads.getbouncer.com/swift_package_manager/2.1.2/CardScan.xcframework.zip, NSErrorFailingURLKey=https://downloads.getbouncer.com/swift_package_manager/2.1.2/CardScan.xcframework.zip, _kCFStreamErrorDomainKey=12}")2023-06-25 09:27:27.677 xcodebuild[70547:21580555] DTDKRemoteDeviceConnection: Failed to start remote service "com.apple.mobile.notification_proxy" on device. Error: Error Domain=com.apple.dtdevicekit Code=811 "Failed to start remote service "com.apple.mobile.notification_proxy" on device." UserInfo={NSUnderlyingError=0x600002c41d40 {Error Domain=com.apple.dt.MobileDeviceErrorDomain Code=-402653158 "The device is passcode protected." UserInfo={MobileDeviceErrorCode=

App Store App crash

Screenshot 2023-09-19 at 12 44 04 PM

App is getting crashed on App Store app while trying to access ScanViewController while works fine in debug builds. I am not able to figure out reason for crash. CardScan is added by pod file.

Carthage failed with exit code 74

I would like to add the cardscan-ios library to my project using Carthage. I used the example found here
After running carthage update command in terminal I get error:

A shell task (/usr/bin/xcrun xcodebuild -project /Users/robertmietelski/Desktop/Test/Carthage/Checkouts/cardscan-ios/SpmXCFrameworkTest/SpmXCFrameworkTest.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 74:
xcodebuild: error: Could not resolve package dependencies:
  Failed to clone repository /Users/kingst/work/cardscan-ios:
    fatal: repository '/Users/kingst/work/cardscan-ios' does not exist

Zrzut ekranu 2021-12-29 o 09 29 42

Does anyone know how to fix this?

CardScan class same name as module CardScan

I just updated from an older version (from october) to the previous version 1.0.5029 and I get a new error caused by name conflicts.

In my app I have a custom class called CreditCard (same as in module CardScan) so I have to distinguish them apart by prefixing CardScan.CreditCard.

The problem now is I see a new class (introduced in #114) CardScan.

This breaks my code and I can no longer distinguish my CreditCard class apart from yours.

Don't name classes/structs/enums the same name as your module, bad practice.

I have downgraded to 1.0.5027 as for now until this problem gets fixed.

License

As read the license there is no limitation to use the sdk in commercial projects, as long as we do not require support or customizations?

Rare crash on an iPhone SE(2nd Generation)

Hello, i have this strange crash with the flag SIGABART(in DEBUG mode) when I try to assign any value to the instance of ScanViewController (CardScan version 2.0.7).

Captura de Pantalla 2021-02-18 a la(s) 1 43 00 a  m

That only happen in a real device, the iPhone SE(2nd Generation), iOS 14.4 . I already tried with the Simulator and an iPhone 12(iOS 14.4 too) but nothing bad happens. The crash only happens on the iPhone SE.

By the way it works fine and displays correctly if I type the following

    func recognizerScanCard() -> ScanViewController?
    {
        guard let vc = ScanViewController.createViewController(withDelegate: self) else {
            return nil
        }
        
        // vc.stringDataSource = self
        // vc.cornerColor = UIColor(hexString: "002BD9")
        // vc.allowSkip = true
        
        return vc
        
    }

    @IBAction func buttonScanCardPressed(_ sender: AnimatableButtonCustomized)
    {
        if let vc = self.recognizerScanCard() {
            self.present(vc, animated: true, completion: nil)
        }
        
    }

Best regards

Crashes on SwiftUI

Hii,

This library works fine for storyboard projects, but it crashes in SwiftUI. I integrated ScanViewController in swiftUI by using UIViewControllerRepresentable. But when I click on the button to open it the App crashes.

I’m attaching my scanner file.Please review it and let me know if I’m doing something wrong.

CardScanner.swift.zip

Release 1.0.5024 breaks Carthage

Release 1.0.5024 breaks Carthage compatibility.

Carthage error message: Dependency "cardscan-ios" has no shared framework schemes for any of the platforms: iOS

I may have time to look at this myself, just wanted to file an issue asap - for the time being I'm using 1.0.5023.

Why restrict iOS version to iOS 11.2+

In ScanBaseViewController.captureOutputWork(sampleBuffer:) - line 342, there is an iOS version constraint and I cannot figure it why.

And I can't found any calls to iOS 11.2+ API of SSDCreditCardOcr.
So why there is an iOS 11.2+ Constraint ?

ScanViewController no 'configureWithApiKey' method

I'm configuring CardScan in an Objective-C project. The documentation says:

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [ScanViewController configureWithApiKey:@"YOUR_API_KEY_HERE"];
    return YES;
    }

I want to set the Key but there is no configureWithApiKey method:
Captura de Pantalla 2019-09-18 a la(s) 10 26 56

Only configure method:
Captura de Pantalla 2019-09-18 a la(s) 10 25 42

Where the key must be set?

How to customize the overlay?

The lib works pretty well, but the customization link on the docs is broken.

How to customize the overlay?

We're trying to put a style like this:

image

Orientation problems on iPad

I've been working on implementing this for the last day or so but I've run into a couple issues related to orientation.

When changing from landscape to portrait, the blur background doesn't come with it and ends up at half height to match the landscape view.

The camera always rotates no matter what I've tried, making the view very hard to use on landscape.

Currently I'm loading the scanner as a child view of a modal, but loading it directly products the same (albeit much bigger) problems.

Any suggestions for how to resolve these issues would be fantastic.

Code is Swift 2.x and not 4

I'm trying to install ScanCard in my project written in Objective-C. I installed the pod and when I open my workspace I get this message:

Unsupported Swift Version
The target “CardScan” contains source code developed with Swift 2.x. This version of Xcode does not support building or migrating Swift 2.x targets.

Use Xcode 8.x to migrate the code to Swift 3.

Captura de Pantalla 2019-09-14 a la(s) 13 04 19

I'm using XCode 10.1 and macOS Mojave 10.14.5

EXC_BAD_ACCESS on VideoFeed.swift line 104: session.addInput(videoDeviceInput)

When trying to scan a credit card after using the camera, the video preview window appears empty and we get Thread 9: EXC_BAD_ACCESS (code=2, address=0x16db6fff8). The line of code that is failing is VideoFeed.swift, line 104: session.addInput(videoDeviceInput).

I've reproduced the error in CardScan - Example by adding a button that opens a standard UIImagePickerController. If you open the camera using the UIImagePickerController 3+ times and then tap the Scan Card button, the error will happen.

Can not edit any thing

hey,
first thanks very much this library awesome
i need any advice to edit some points :
1- Hide flash button or change the icon .
2- change the corner radius for indicator in the corner focus area , and change color of it .
3- this point very important any way to hide the text (numbers & expiry date) after catch the info from card , i mean when catch the card number the number show before dismiss .
4- change the font and change labels properties like (lines number) .
i’m sorry to ask many questions, but i think it’s important, any advice to edit or change it please .

SDK didnt handle scanning error

While I was trying to handle the scan credit card's failure, there is no firing for the error when it happened:

for instance:

@available(iOS 11.0, *)
    func blockingOcrModel(rawImage: CGImage) {
        let (number, expiry, done, foundNumberInThisScan) = ocr.performWithErrorCorrection(for: rawImage)
        if let number = number {
            self.showCardNumber(number, expiry: expiry?.display())
            if self.includeCardImage && foundNumberInThisScan {
                self.scannedCardImage = UIImage(cgImage: rawImage)
            }
        }
        
        if done {
            DispatchQueue.main.sync {
                guard let number = number else {
                    return
                }
                
                if self.calledDelegate {
                    return
                }
                
                let notification = UINotificationFeedbackGenerator()
                notification.prepare()
                notification.notificationOccurred(.success)
                //let vibrate = SystemSoundID(kSystemSoundID_Vibrate)
                //AudioServicesPlaySystemSound(vibrate)
                
                self.calledDelegate = true
                let card = CreditCard(number: number)
                card.expiryMonth = expiry.map { String($0.month) }
                card.expiryYear = expiry.map { String($0.year) }
                card.image = self.scannedCardImage
                self.scanDelegate?.userDidScanCard(self, creditCard: card)
            }
        }
    }

Here:
It checks if the number is nill (which means there is an error while scanning) then it returns without call self.scanDelegate?.userDidScanCard which means didn't fire the error?

Maybe there is something I'm missing, but I would appreciate if you could clarify how can I handle the error when it happened.

Trying to scan the card but app crashes in iPhone 8

I have implemented this code and while running app on iPhone 11 its working properly, scans card number , expiry month and expiry year. But when running app in iPhone 8 while scanning I only get the card number and expiry year & month is getting nil.
Is this issue is device specific?

Card Type in iOS

Hi Team,

Please can you let me know how to get card type in iOS, in android we have network as a field to get the card type.

Enhancement: right bar button item

We are using CardScan in our app, and we are presenting the ScanViewController modally, embedded in a navigation controller. The navigation controller is hidden by ScanViewController, which is understandable, but our app has rules around modally presented view controllers whereby we always show an X button to close in the top right. Obviously, you provide a back button (outside of a navigation item) on the left side of the view controller, and it would be great to have the flexibility to choose where this is positioned (left or right), and an image for the button.

Error Uploading to App Store

I adapted CardScan from Carthage to Swift Package Manager, removed the reference to / usr / local / bin / carthage copy-frameworks that belonged to CardScan now when uploading the app the next error appears. (see the next image)

If you can, try including CardScan with Swift Package Manager in an app and try uploading the Build to the App Store
Captura de Pantalla 2021-02-09 a la(s) 6 16 23 p  m

Unable to override ScanBaseViewController

Both methods of protocol ScanEvents are marked as public in ScanBaseViewController. Due to this fact, we're not able to override these methods.

Is the possibility to change these methods to open?

@objc open class ScanBaseViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate, ScanEvents, AfterPermissions {
    
    public func onNumberRecognized(number: String, expiry: Expiry?, cardImage: CGImage, numberBoundingBox: CGRect, expiryBoundingBox: CGRect?) {
        // relay this data to our own delegate object
        self.scanEventsDelegate?.onNumberRecognized(number: number, expiry: expiry, cardImage: cardImage, numberBoundingBox: numberBoundingBox, expiryBoundingBox: expiryBoundingBox)
    }
    
    public func onScanComplete(scanStats: ScanStats) {
        // this shouldn't get called
    }
   ...
}

Performance and memory leaks

After dismissing the view my custom subclass of ScanBaseViewController is leaking. Moreover, after dismissing the view before it loads makes CPU usage be still on ~30% on a real device when I dismiss the view. I think removing memory leaks of the ScanBaseViewController would do the thing

Customize

Hello dear developers.Can i use default scanner UI and also change there only description text? Or it's required to use SimpleScanViewController? And also please guide more examples to customization please.Thanks

Card scan

Can you add prefixes for cards in Uzbekistan 8600 Uzcard, 9860 Humo

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.