Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Issues on iOS11 #267

Open
muncheta opened this issue Oct 9, 2017 · 15 comments
Open

Issues on iOS11 #267

muncheta opened this issue Oct 9, 2017 · 15 comments

Comments

@muncheta
Copy link

muncheta commented Oct 9, 2017

General information

SDK/Library version: 5.4.1
iOS Version and Device: iOS 11 on an iPhone 6s

Hi,
Have there been any reported issues with iOS11? We are currently having an issue where our app freezes and crashes when the Card.io function is initiated on an iOS11 device.

Any help would be greatly appreciated.

Thanks,
Josh

@Takadimi
Copy link

We're having a similar issue. The app isn't crashing, but the delegate methods we defined for userDidCancel and userDidProvide fail to fire in iOS 11 (Swift 3.2).

@bluk
Copy link
Contributor

bluk commented Oct 10, 2017

Can you please provide more details?

Which version of Xcode did you use to build your app? Do the delegate methods still get called in iOS 9/10/etc.?

@Gerst20051
Copy link

Gerst20051 commented Oct 10, 2017

I can verify that it works correctly built in Xcode 9 using an iOS 10.3 Simulator. @bluk

@Gerst20051
Copy link

Hey @bluk any luck with this issue? Any way I can be of assistance?

@bluk
Copy link
Contributor

bluk commented Oct 17, 2017

@Gerst20051 Are you able to run the demo app in https://github.com/card-io/card.io-iOS-source ? Running it in iOS 11 for me seems to present the correct delegate calls for userDidCancel... and userDidProvide....

@SchmidtyApps
Copy link

@bluk @Gerst20051 I believe I have narrowed down what is causing the delegate functions not to fire only on iOS 11. It looks like when there is a tap gesture recognizer added above the CardIOPaymentViewController(for instance having a touch recognizer on the entire window) the cancel/done button events do not fire on iOS 11 although they work fine on iOS9/10. I have attached a link to a sample project I built showing the issue.

https://github.com/SchmidtyApps/CardIOSwiftExampleIssue

@aalvarez255
Copy link

Any workaround for this issue? Unfortunately, we can’t stop using gesture recognizers in our app.

@SchmidtyApps
Copy link

@aalvarez255 There are a couple options I found:

1.) Instead of adding the gesture recognizer to the window or on top of everything, you can just add it to the ViewController view so that the gesture isn't over the Navigation Bar which is what actually causes the interference.

2.) Keep a reference to the gesture recognizer you are adding and when you launch card.io temporarily disable it while showing the card.io ViewController. Then when the scan is done or user hits cancel enable the gesture again.

3.) Use the CardIOView to build your own custom screen which is the option I ultimately used. https://github.com/card-io/card.io-iOS-SDK#integrate-as-a-view

@z0lberg
Copy link

z0lberg commented Nov 16, 2017

@aalvarez255 try start CardIOs view as modal, it is works for me on Xamarin

@aznelite89
Copy link

aznelite89 commented Dec 13, 2017

I had similar issue happen on my iOS 11 devices , the didScanCard delegate method and didProvide methods never being called on my apps. However , one of the delegate method which is userDidCancel did fired when I tap cancel button... anyone experience this issue ? My card.iO SDK version is 5.4.1 and without PayPal SDK.

@OmegaPrimeZ3
Copy link

I am having an intermittent issue as well. When hitting cancel, the view slides down slightly (Like its closing) and then stops. The delegate methods are never called so the view is not fully dismissed. I tried the opening as modal, but the issue still occurs. Has anyone found a perm workaround/fix?

@crs2m5smith
Copy link

@OmegaPrimeZ3 Were you able to resolve this issue?

@crs2m5smith
Copy link

crs2m5smith commented Jul 20, 2018

Or did anyone resolve this issue pertaining to cancel/done buttons not firing on ios 11.x? Seems like iOS 11.x Card IO does not call the same delegates for Cancel/Done?

@crs2m5smith
Copy link

`public class CardIORenderer : PageRenderer
{
private bool bViewAlreadyDisappeared = false;
private CardIOPage cardIOPage;

public CardIORenderer()
{

}
protected override void OnElementChanged(VisualElementChangedEventArgs e)
{
    base.OnElementChanged(e);
    cardIOPage = e.NewElement as CardIOPage;
}
public override void ViewDidAppear(bool animated)
{
    base.ViewDidAppear(animated);

    if (bViewAlreadyDisappeared) return;

    var paymentDelegate = new CardIOPaymentViewControllerDg(cardIOPage);

    // Create and Show the View Controller
    var paymentViewController = new CardIOPaymentViewController(paymentDelegate,true);
    paymentViewController.CollectExpiry = cardIOPage.cardIOConfiguration.RequireExpiry;
    paymentViewController.CollectCVV = cardIOPage.cardIOConfiguration.RequireCvv;
    paymentViewController.CollectPostalCode = cardIOPage.cardIOConfiguration.RequirePostalCode;
    paymentViewController.HideCardIOLogo = cardIOPage.cardIOConfiguration.HideCardIOLogo;
    paymentViewController.CollectCardholderName = cardIOPage.cardIOConfiguration.CollectCardholderName;
    if (!string.IsNullOrEmpty(cardIOPage.cardIOConfiguration.Localization)) paymentViewController.LanguageOrLocale = cardIOPage.cardIOConfiguration.Localization;
    if (!string.IsNullOrEmpty(cardIOPage.cardIOConfiguration.ScanInstructions)) paymentViewController.ScanInstructions = cardIOPage.cardIOConfiguration.ScanInstructions;

    // Not sure if this needs to be diabled, but it doesn't seem like something I want to do.
    paymentViewController.AllowFreelyRotatingCardGuide = false;
    Device.BeginInvokeOnMainThread(() =>
    {
        var window = UIApplication.SharedApplication.KeyWindow;
        var vc = window.RootViewController;
        while (vc.PresentedViewController != null)
        {
            vc = vc.PresentedViewController;
        }
        // Display the card.io interface
        vc.PresentViewController(paymentViewController, true, null);
    });


}
public override void ViewDidDisappear(bool animated)
{
    base.ViewDidDisappear(animated);
    bViewAlreadyDisappeared = true;
}

}
public class CardIOPaymentViewControllerDg : CardIOPaymentViewControllerDelegate
{
private CardIOPage cardIOPage;
private CardIOCard cardIOCard = new CardIOCard();
public CardIOPaymentViewControllerDg(CardIOPage page)
{
cardIOPage = page;

}
public override void UserDidCancelPaymentViewController(CardIOPaymentViewController paymentViewController)
{
    paymentViewController.DismissViewController(true, null);
    MessagingCenter.Send<CardIOCard>(cardIOCard, "CreditCardScanCancelled");
}

public override void UserDidProvideCreditCardInfo(CreditCardInfo card, CardIOPaymentViewController paymentViewController)
{
    paymentViewController.DismissViewController(true, null);

    if (card == null)
        MessagingCenter.Send<CardIOCard>(cardIOCard, "CreditCardScanCancelled");
    else
    {
        cardIOCard.cardNumber = card.CardNumber;
        cardIOCard.ccv = card.Cvv;
        cardIOCard.exprMonth = card.ExpiryMonth.ToString();
        cardIOCard.exprYear = card.ExpiryYear.ToString();
        cardIOCard.redactedCardNumber = card.RedactedCardNumber;
        cardIOCard.cardholderName = card.CardholderName;

        MessagingCenter.Send<CardIOCard>(cardIOCard, "CreditCardScanSuccess");
    }
}

}

This is what I have for the code`

@crs2m5smith
Copy link

@aznelite89 did you resolve your issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants