Search code examples
card.io

Card.io not scanning


I followed all of the instructions for card.io.

The camera comes up looks like it's scanning but never returns through the delegate. Am I missing something?

Even when I try the example it and put in my app id and it doesn't scan. Do I just have to wait a long time for the scan?

Here is my code

.h file

@interface MasterCheckoutCreditCardViewController : UIViewController<CardIOViewDelegate>

.m file

- (void)viewDidLoad {
    [super viewDidLoad];

    if (![CardIOView canReadCardWithCamera]) {
        NSLog(@"troubles in paradise");
    }

    CardIOView* cioView = [[CardIOView alloc]initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 200)];
    cioView.appToken = @"app_token";
    cioView.delegate = self;
    cioView.guideColor = [UIColor whiteColor];
    [self.view addSubview:cioView];

}

-(void)cardIOView:(CardIOView *)cardIOView didScanCard:(CardIOCreditCardInfo *)cardInfo {
    if (cardInfo) {
        // The full card number is available as info.cardNumber, but don't log that!
        NSLog(@"Received card info. Number: %@, expiry: %02i/%i, cvv: %@.", cardInfo.redactedCardNumber, cardInfo.expiryMonth, cardInfo.expiryYear, cardInfo.cvv);
        // Use the card info...
    }

}

Solution

  • Dave from card.io here.

    Have you tried a variety of credit cards? There are many cards that card.io will not successfully scan. These include the newer style cards, which lack the traditional large, embossed card numbers. Even among traditional cards, there are some whose background color or pattern makes scanning difficult.

    I would suggest trying some straightforward, traditional VISA or MasterCard cards to start.