-
-
Notifications
You must be signed in to change notification settings - Fork 565
Back Button Navigation Issue with Stripe Payment Gateway in Flutter #1822
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
Comments
"where Stripe payment is implemented" |
Back button closes app when using app instead of going to previous page. |
Can you provide a reproducible example here? because in my app the backbutton behavior works as expected. Same goes for the example app |
I am facing the similar issue. Back button is closing the app after integrating stripe |
I tried solving the issues. This issue is related to issue/related to predictive back not being supported. Here's a github issues which sums up the issue. flutter/flutter#141564 (comment) Also to resolve it. Here is a sample AndroidManifest.xml file - <activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:enableOnBackInvokedCallback="false"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
|
But it's not woking
…On Thu, Jul 4, 2024 at 7:29 PM Shashikant Dwivedi ***@***.***> wrote:
I tried solving the issues. This issue is related to issue/related to
predictive back not being supported. Here's a github issues which sums up
the issue.
flutter/flutter#141564 (comment)
<flutter/flutter#141564 (comment)>
Also to resolve it. Here is a sample AndroidManifest.xml file -
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
***@***.***/LaunchTheme"
android:enableOnBackInvokedCallback="false"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as the Android process has started. This theme is visible to the user while the Flutter UI initializes. After that, this theme continues to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
***@***.***/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Here, After adding this - android:enableOnBackInvokedCallback="false" in Activity solves the issues for me.
—
Reply to this email directly, view it on GitHub
<#1822 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BJOW4VBG4M2QZMMJLAXINV3ZKVIK7AVCNFSM6AAAAABJ5QGTV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGA3DONRTGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Seemanth Sindhukuttan : Flutter Developer*
*Office: *+91 484 4052626 | www.webcastle.in
|
Can you please share more details. Like -
1. Flutter version
2. Kotlin version
Also can you make sure that you have done implementation as per the
documentation.
Also try after adding progaurd rules. Also in app/build.gradle , add this -
```
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run
--release` works.
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile("proguard-android.txt"), "
proguard-rules.pro"
}
}
```
On Fri, Jul 5, 2024 at 9:52 AM SeemanthWebcastle ***@***.***>
wrote:
… But it's not woking
On Thu, Jul 4, 2024 at 7:29 PM Shashikant Dwivedi ***@***.***>
wrote:
> I tried solving the issues. This issue is related to issue/related to
> predictive back not being supported. Here's a github issues which sums
up
> the issue.
>
> flutter/flutter#141564 (comment)
> <
flutter/flutter#141564 (comment)>
>
> Also to resolve it. Here is a sample AndroidManifest.xml file -
>
> <activity
> android:name=".MainActivity"
> android:exported="true"
> android:launchMode="singleTop"
> ***@***.***/LaunchTheme"
> android:enableOnBackInvokedCallback="false"
>
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
> android:hardwareAccelerated="true"
> android:windowSoftInputMode="adjustResize">
> <!-- Specifies an Android theme to apply to this Activity as soon as the
Android process has started. This theme is visible to the user while the
Flutter UI initializes. After that, this theme continues to determine the
Window background behind the Flutter UI. -->
> <meta-data
> android:name="io.flutter.embedding.android.NormalTheme"
> ***@***.***/NormalTheme"
> />
> <intent-filter>
> <action android:name="android.intent.action.MAIN"/>
> <category android:name="android.intent.category.LAUNCHER"/>
> </intent-filter>
>
>
> </activity>
>
> Here, After adding this - android:enableOnBackInvokedCallback="false" in
Activity solves the issues for me.
>
> —
> Reply to this email directly, view it on GitHub
> <
#1822 (comment)>,
> or unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/BJOW4VBG4M2QZMMJLAXINV3ZKVIK7AVCNFSM6AAAAABJ5QGTV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGA3DONRTGQ>
> .
> You are receiving this because you authored the thread.Message ID:
> ***@***.***>
>
--
*Seemanth Sindhukuttan : Flutter Developer*
*Office: *+91 484 4052626 | www.webcastle.in
—
Reply to this email directly, view it on GitHub
<#1822 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AONUPGEQIYN25D4VOM47NHLZKYNOTAVCNFSM6AAAAABJ5QGTV6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMJQGEYTENJUHA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
This is not something we can change in our library. Stripe requires us to use the FlutterFragmentActivity so I would recommend if you experience problems with the backbutton to raise a ticket there. |
I am a Flutter developer integrating Stripe payment gateway into my Flutter application. Following the documentation, I switched from using FlutterActivity to FlutterFragmentActivity in MainActivity.kt. After making this change, the back button functionality in my app stopped working as expected.
Steps to Reproduce:
Expected Behavior:
When pressing the back button, the app should navigate back to the previous screen within the app.
Actual Behavior:
After switching to FlutterFragmentActivity, pressing the back button navigates the app to the home screen of the device instead of navigating back within the app.
Additional Information:
Possible Cause:
The change to FlutterFragmentActivity may have affected the handling of back button events within the Flutter application, possibly due to differences in how FlutterFragmentActivity manages the Flutter view compared to FlutterActivity.
Thank you for your attention to this matter. Please let me know if you require further clarification or additional information to investigate and address this issue effectively.
The text was updated successfully, but these errors were encountered: