Closed sidatgoodvet closed 1 year ago
I now know the problem, for anyone else facing this issue. Please make sure you do not let call
InAppPayments.completeCardEntry(
onCardEntryComplete: _onCardEntryComplete);
after calling InAppPayments.showCardNonceProcessingError(error)
or else the app will crash at least on iOS
Describe the issue
The app crashes with an uncaught exception after calling InAppPayments.showCardNonceProcessingError() on iOS. The log shows a SIGABRT signal and "objc_exception_throw", indicating an Objective-C exception was thrown and not caught, causing the crash.
Here are the key parts of the crash report:
Incident Identifier: 5CF54276-3A19-45F3-924E-3C456127C6C7
Hardware Model: iPhone12,1
Process: Runner [11779]
Path: /private/var/containers/Bundle/Application/2583D982-56DF-4596-A734-C6F193C6B2E2/Runner.app/Runner
Version: 1.0.5 (38)
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
The key parts are:
To Reproduce
Initialize the In-App Payments SDK Call InAppPayments.showCardNonceProcessingError() The app crashes Here is the code:
InAppPayments.showCardNonceProcessingError(error); // Crashes on iOS
Expected behavior
The method should display an error message to the user without crashing the app.
Environment:
Platform: iOS OS: iOS 16.4 Development environment: macOS Ventura 13.4 (22F66) In-App Payments plugin version: 1.7.6
### Flutter Doctor flutterdoctor.txt
Screenshots
N/A
Additional context
The crash only happens on iOS, not Android. Im using the latest version of the In-App Payments SDK for flutter (square_in_app_payments: ^1.7.6)