Open sebj54 opened 2 years ago
The problem seems to be caused by SFSafariViewController
called in the background. Therefore, iOS prevent page loading to avoid apps tracking users with background webviews (see https://blog.rizwan.dev/blog/blank_safari_viewcontroller).
If I understand correctly, UIViewControllerImpl
is considered background?
It seems I have to do something like this to return the rootViewController
:
extension PaymentGatewayController: STPAuthenticationContext {
func authenticationPresentingViewController() -> UIViewController {
return self
}
}
The problem is I don't know how to do it with NativeScript :/
EDIT
It turns out the plugin already does this part: https://github.com/triniwiz/nativescript-plugins/blob/12f13aeb7361cb9c28554bcb90974587e5527084/packages/nativescript-stripe/index.ios.ts#L351-L366
I finally find a fix (at least in my case)!
Replace this line: https://github.com/triniwiz/nativescript-plugins/blob/12f13aeb7361cb9c28554bcb90974587e5527084/packages/nativescript-stripe/index.ios.ts#L339
by
const rootVC = UIApplication.sharedApplication.keyWindow.rootViewController;
I would be happy to make a PR for this fix, but I think we should discuss it before to avoid breaking other users' apps. What do you think @triniwiz?
Hi there,
I have an issue with iOS and SCA with the Stripe plugin. I have tested it with latest 7 and 8 versions and the same problem occurs. I'm using latest NativeScript-Vue (+ {N} 8.2).
When confirming a setup intent or a payment intent with a 3DS2 test card (for instance:
4000002760003184
), the SCA page is blank.I opened Safari DevTools to check the page URL and it is
about:blank
. I added a breakpoint in the Stripe pod's code and the URL is correct in the SDK whenSFSafariViewController
is presented.There is no error, just a warning:
Do you have any idea I can try to debug this?
If you think it can help, I can produce a sample project (which I don't have yet).