in-app-payments-react-native-plugin icon indicating copy to clipboard operation
in-app-payments-react-native-plugin copied to clipboard

Allow iOS presentation when already presenting

Open mgray88 opened this issue 6 months ago • 1 comments

Summary

iOS does not allow presenting view controllers when one is already presented. The in-app-payments library does not handle the case of a developer trying to present the card entry form from an already presented view controller, and instead just crashes.

I have "fixed" it for the particular case for our app, however I apologize I do not have the time to flesh out the functionality for every case. Therefore this is a draft PR. Additionally, it's really only a bandaid, as the developer would still be expected to be presenting a UINavigationController for this to work (though I would imagine react-native-screens or whatever library is probably already doing that by default).

Another potential fix that I have seen used previously, is to create a separate UIWindow, layering it over top of the existing app. That would bypass the problem entirely, but require much more refactoring.

Changelog

  • fix: allow presenting from presented navigation controller in startCardEntryFlow

mgray88 avatar Jun 02 '25 11:06 mgray88