Fix CashApp return crash by preventing fragment state restoration
Prevent Stripe PaymentSheetFragment restoration crash when returning from CashApp authorization by removing fragment state from saved instance bundle. This fixes the rare crash: "Unable to instantiate fragment com.reactnativestripesdk.PaymentSheetFragment: could not find Fragment constructor" Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
e8c99844f8
commit
213bc5e401
1 changed files with 10 additions and 1 deletions
|
|
@ -1,5 +1,14 @@
|
||||||
package com.payfrit.app
|
package com.payfrit.app
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
import io.flutter.embedding.android.FlutterFragmentActivity
|
import io.flutter.embedding.android.FlutterFragmentActivity
|
||||||
|
|
||||||
class MainActivity : FlutterFragmentActivity()
|
class MainActivity : FlutterFragmentActivity() {
|
||||||
|
// Fix crash when returning from CashApp/external payment authorization
|
||||||
|
// Stripe SDK fragments don't properly support state restoration
|
||||||
|
override fun onSaveInstanceState(outState: Bundle) {
|
||||||
|
super.onSaveInstanceState(outState)
|
||||||
|
// Remove fragment state to prevent Stripe PaymentSheetFragment restoration crash
|
||||||
|
outState.remove("android:support:fragments")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue