From adce2600902ba7413a1974a03ccc02fdb8442060 Mon Sep 17 00:00:00 2001
From: Joseph Pender
Date: Thu, 31 Jul 2025 11:41:51 -0500
Subject: [PATCH 1/2] =?UTF-8?q?Adding=20support=20for=20App=E2=80=99s=20ba?=
=?UTF-8?q?ckButton=20toggling=20and=20config?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
capacitor.config.ts | 8 ++++++--
src/pages/App.tsx | 23 +++++++++++++++++++----
2 files changed, 25 insertions(+), 6 deletions(-)
diff --git a/capacitor.config.ts b/capacitor.config.ts
index 3c391500..8d4eebc2 100644
--- a/capacitor.config.ts
+++ b/capacitor.config.ts
@@ -1,6 +1,7 @@
///
///
///
+///
import { CapacitorConfig } from '@capacitor/cli';
@@ -23,8 +24,11 @@ const config: CapacitorConfig = {
iconColor: '#CE0B7C',
},
PushNotifications: {
- presentationOptions: ["alert", "sound"]
- }
+ presentationOptions: ['alert', 'sound'],
+ },
+ App: {
+ disableBackButtonListener: false,
+ },
},
};
diff --git a/src/pages/App.tsx b/src/pages/App.tsx
index 251f2c80..673a7290 100644
--- a/src/pages/App.tsx
+++ b/src/pages/App.tsx
@@ -118,6 +118,14 @@ const AppPage: React.FC = () => {
await AppLauncher.openUrl({ url: '' });
};
+ const enableBackButtonHandler = async () => {
+ await App.toggleBackButtonHandler({ enabled: true });
+ };
+
+ const disableBackButtonHandler = async () => {
+ await App.toggleBackButtonHandler({ enabled: false });
+ };
+
useIonViewDidLeave(() => {
stateChangeHandler.remove();
urlOpenHandler.remove();
@@ -160,8 +168,16 @@ const AppPage: React.FC = () => {
Test Failing Call
-
- {/* If the link above ever expires, this is the HTML to test opening an intent for this app.
+
+ Enable Back Button Handler
+
+
+ Disable Back Button Handler
+
+
+ {/* If the link above ever expires, this is the HTML to test opening an intent for this app.
From e4d6df18ee94232af0d57aae26327d6db6cad567 Mon Sep 17 00:00:00 2001
From: Joey Pender
Date: Tue, 16 Sep 2025 17:47:04 -0500
Subject: [PATCH 2/2] use updated name for setting
Co-authored-by: jcesarmobile
---
capacitor.config.ts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/capacitor.config.ts b/capacitor.config.ts
index 8d4eebc2..4b397bec 100644
--- a/capacitor.config.ts
+++ b/capacitor.config.ts
@@ -27,7 +27,7 @@ const config: CapacitorConfig = {
presentationOptions: ['alert', 'sound'],
},
App: {
- disableBackButtonListener: false,
+ disableBackButtonHandler: false,
},
},
};