Comments (13)
@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
}
}
}`
from xamarincomponents.
@Redth Can you please look into this.
Thanks
from xamarincomponents.
@bholmes @mattleibow
Can you guys please look into this as well
I am stuck at this since last week
from xamarincomponents.
Can you please specify which component is giving the problem. Is this CardIO?
from xamarincomponents.
@bholmes Yes
from xamarincomponents.
@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.
from xamarincomponents.
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
from xamarincomponents.
@jeremymarabel
My screen also stucks there
the buttons don't work at all
Sometimes it crashes and sometimes it doesn't
from xamarincomponents.
@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 :/
from xamarincomponents.
Has anyone resolved this issue? I am implementing this with Xamarin Forms and ran into same issue with buttons not firing.
from xamarincomponents.
@crs2m5smith Could you provide a sample project and further details about the version of iOS etc that you are using
from xamarincomponents.
@newky2k ^ Check this one.
from xamarincomponents.
Thanks for following up 🥇
from xamarincomponents.
Related Issues (20)
- <!--
- Xamarin.Azure.NotificationHubs.iOS 3.1.1 is not compatible with net6.0-ios15.4 HOT 3
- Xamarin.Forms.GoogleMaps.iOS.PlatformConfig issues
- Xamarin.Android ARCore Geospatial not currently working
- Sceneform Xamarin.Android binding from the maintained version
- Xamarin.SDWebImage : SetImage() - CGImageCreate: invalid image byte order info for bitsPerPixel HOT 3
- Update "Xamarin.Io.CoilKt.Coil" to "2.2.2"
- I have a problem when installing GooglePlayService.Auth 120.3.0 not compatible with monoAndroid 11.0 HOT 1
- Xamarin.Build.Download.0.11.3 giving error XBD020: Invalid item ID image-1.0.0-beta1 for Xamarin.Google.Android.ODML.Image -Version 1.0.0.2-beta1
- The "ManifestMerger" task failed unexpectedly
- Announcement: Deprecated Repository
- Xamarin.Google.Android.Vending.Expansion.Downloader: PendingIntent Flags on Android 31 HOT 1
- How to disable bitcode strip for Google Sign In ? HOT 2
- Add GoogleServicesJson Build Action HOT 3
- How do i use audioswitch from xamarin
- Unable to bind native iOS framework that uses Async/Await in iOS 14 HOT 13
- iOS issue with notification hubs
- TextInputControllerOutlinedTextArea with MultilineTextField
- Azure.NotificationHubs.iOS for .net Maui
- my solution
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 xamarincomponents.