Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuck at Card entry Page on iOS 10.3 #152

Closed
wal33d006 opened this issue May 15, 2017 · 13 comments
Closed

Stuck at Card entry Page on iOS 10.3 #152

wal33d006 opened this issue May 15, 2017 · 13 comments
Labels
needs-info More information is requested by engineering

Comments

@wal33d006
Copy link

As I navigate to the manual card entry page, the "cancel" and "done" buttons of the card entry screen don't work. I have used breakpoints in my code. Even the handlers aren't called on the button clicks.
After the card details are entered, the "done" button doesn't work and the cancel button crashes the application.
whatsapp image 2017-05-15 at 4 46 16 pm
whatsapp image 2017-05-15 at 4 46 17 pm

@wal33d006
Copy link
Author

@Redth Can you please look into this.
Thanks

@wal33d006
Copy link
Author

@bholmes @mattleibow
Can you guys please look into this as well
I am stuck at this since last week

@bholmes
Copy link
Contributor

bholmes commented May 17, 2017

Can you please specify which component is giving the problem. Is this CardIO?

@wal33d006
Copy link
Author

@bholmes Yes

@Redth
Copy link
Member

Redth commented May 17, 2017

@wal33d006 does the sample work for you? It's working fine for me, I'm unable to reproduce the crash, or the Camera/Done buttons not working.

@jeremymarabel
Copy link

hi @wal33d006 @bholmes ,
I ran into the same issue and found this post. it's a CardIO issue
My app don't crash, but i'm stuck into that screen. It's a bit tricky to reproduce, here are the steps :

_Take a card hard to read (erased numbers or something) or simply hide some numbers with your finger
_Try to scan the credit card (the all square must be green)
_While the component try to scan, click on the cancel button

You should now be stuck in the card scanner.

Hope this can be fixed, thank you in advance

@wal33d006
Copy link
Author

@jeremymarabel
My screen also stucks there
the buttons don't work at all
Sometimes it crashes and sometimes it doesn't

@Redth
Copy link
Member

Redth commented May 31, 2017

@jeremymarabel and @wal33d006 please try the sample located here: https://github.com/xamarin/XamarinComponents/tree/master/XPlat/CardIO/iOS/samples

I still can't reproduce the issue.

Also, if you can share some code to show how you're using Card.IO that would help. I tried the steps of trying to read a card with missing numbers and pressing cancel when the square was all green. It works fine here :/

@crs2m5smith
Copy link

Has anyone resolved this issue? I am implementing this with Xamarin Forms and ran into same issue with buttons not firing.

@newky2k
Copy link
Contributor

newky2k commented Jul 24, 2018

@crs2m5smith Could you provide a sample project and further details about the version of iOS etc that you are using

@newky2k newky2k added the needs-info More information is requested by engineering label Jul 24, 2018
@crs2m5smith
Copy link

@newky2k I was actually able to resolve this for me. I will post code below. Issue turned out to move the delegate scope with the PageRenderer class and not creating new instance of it on ViewDidAppear
` public class CardIORenderer : PageRenderer
{
private bool bViewAlreadyDisappeared = false;
private CardIOPage cardIOPage;
private CardIOPaymentViewControllerDelegate cardIOPaymentViewControllerDelegate;
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;

        cardIOPaymentViewControllerDelegate = new CardIOPaymentViewControllerDg(cardIOPage);

        // Create and Show the View Controller
        var paymentViewController = new CardIOPaymentViewController(cardIOPaymentViewControllerDelegate, true);

        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)
    {
        // do cancel
    }

    public override void UserDidProvideCreditCardInfo(CreditCardInfo card, CardIOPaymentViewController paymentViewController)
    {
        if (card == null)
           // do error
        else
        {
            //do work
        }
    }
}`

@wal33d006
Copy link
Author

@newky2k ^ Check this one.

@Redth
Copy link
Member

Redth commented Jul 26, 2018

Thanks for following up 🥇

@Redth Redth closed this as completed Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-info More information is requested by engineering
Projects
None yet
Development

No branches or pull requests

6 participants