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

IOS App crashes in flutter_stripe:10.0.0, when install from test flight, works well in debug and release mode. #1605

Closed
MuhammadMusa22 opened this issue Jan 20, 2024 · 4 comments
Labels
Awaiting response Awaiting response from the issuer

Comments

@MuhammadMusa22
Copy link

Describe the bug
I was using flutter_stripe: ^9.4.0, stripe payment sheet was working smoothly. Now as i have upgraded my flutter_stripe to 10.0.0, payment sheet crashes only when i install app from test flight. When i run app debug or release mode, it works well without crashing.

I have just removed this issue when i remove returnUrl from initPaymentSheet, then there is no crash, but same returnUrl worked before. I am using this for Klarna payment gateway inside flutter stripe payment sheet. I need to add this for this payment support.

Even i have downgraded my flutter stripe to my old which was 9.4.0 but it is still giving me issue.

To Reproduce
Steps to reproduce the behavior:

  1. Add returnUrl to initPaymentSheet
  2. show payment sheet
  3. Observe a crash.

Smartphone / tablet

  • Device: iPhone XR
  • OS: iOS 16
  • Package version: 10.0.0
  • Flutter version: 3.16.8

Additional context
Info.plist

<key>CFBundleURLTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeRole</key>
			<string>Editor</string>
			<key>CFBundleURLSchemes</key>
			<array>
			    <string>flutterstripe</string>
			</array>
		</dict>

	</array>

Payment sheet code

await Stripe.instance.initPaymentSheet(
      paymentSheetParameters: SetupPaymentSheetParameters(
        customerId: rentingPropertyStripeCredentialsModel.data.customerId,
        customerEphemeralKeySecret: rentingPropertyStripeCredentialsModel.data.ephemeralKey.secret,
        paymentIntentClientSecret: rentingPropertyStripeCredentialsModel.data.clientSecret,
        merchantDisplayName: 'ABC',
        style: ThemeMode.light,
        appearance: const PaymentSheetAppearance(
          colors: PaymentSheetAppearanceColors(primary: AppColors.primaryColor),
        ),
        googlePay: googlePay,
        applePay: applePay,
        allowsDelayedPaymentMethods: true,
       ///this is where issue arises.
        returnURL: 'flutterstripe://com.shipohoi.shipOHoiApp',
      ),
    );
@MuhammadMusa22 MuhammadMusa22 added the needs triage Needs triage label Jan 20, 2024
@MuhammadMusa22
Copy link
Author

@remonh87

@remonh87
Copy link
Member

can you provide me a crash log because for me it works fine. I need the iOS crash logs from xcode.

@remonh87 remonh87 added Awaiting response Awaiting response from the issuer and removed needs triage Needs triage labels Jan 22, 2024
@MuhammadMusa22
Copy link
Author

MuhammadMusa22 commented Jan 23, 2024

@remonh87, In release mode and in debug mode, it is not causing any issue nor adding anything to the terminal regarding some errors. It only happen only when we install this from test flight app when we archive build.

If it is not happening with you, can you please provide how you initated payment sheet with returnUrl, and also how you managed all this in native iOS files of info.plist, let me have a look into this because i have added all this correctly, but still crashing issue.

I am adding returnURL for klarna payment gateway in payment sheet, which won't be showing if we remove returnURL from initPaymentsheet.

@remonh87
Copy link
Member

I would recommend looking here for the dart implementation. See this for ios. I would recommend using some crashlogger (like crashlytics )to provide us the error. Unfortunately I will close it for now but feel free to reopen it when you have a decent stacktrace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting response Awaiting response from the issuer
Projects
None yet
Development

No branches or pull requests

2 participants