6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 840cdcce

AuthorEdmir Suljic<esu@dwarf.dk>
Date2025-05-15 11:03:20 +0200
Reverted back to shared preferences because it was needed in order to work

Changed files

comwell_key_app/ios/Runner.xcodeproj/project.pbxproj | 10 +---------
 comwell_key_app/lib/utils/secure_storage.dart        |  9 ++++++---
 comwell_key_app/pubspec.yaml                         |  1 +
 3 files changed, 8 insertions(+), 12 deletions(-)

Diff

diff --git a/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj b/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj
index 7d7542f2..049c1a9d 100644
--- a/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj
+++ b/comwell_key_app/ios/Runner.xcodeproj/project.pbxproj
@@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
- objectVersion = 60;
+ objectVersion = 54;
objects = {
/* Begin PBXBuildFile section */
@@ -235,14 +235,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
);
- inputPaths = (
- );
name = "[CP] Embed Pods Frameworks";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
);
- outputPaths = (
- );
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
@@ -344,14 +340,10 @@
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
);
- inputPaths = (
- );
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
);
- outputPaths = (
- );
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
diff --git a/comwell_key_app/lib/utils/secure_storage.dart b/comwell_key_app/lib/utils/secure_storage.dart
index be65bc70..7cb8b322 100644
--- a/comwell_key_app/lib/utils/secure_storage.dart
+++ b/comwell_key_app/lib/utils/secure_storage.dart
@@ -1,4 +1,5 @@
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
+import 'package:shared_preferences/shared_preferences.dart';
class SecureStorage {
final FlutterSecureStorage _storage = const FlutterSecureStorage();
@@ -15,12 +16,14 @@ class SecureStorage {
await _storage.delete(key: key);
}
+ //We need to use shared preferences because they are cleared on uninstall unlike flutter secure storage
Future<void> clearKeychainValues() async {
- final isFirstLaunch = await _storage.read(key: 'is_first_app_launch');
+ final prefs = await SharedPreferences.getInstance();
- if (isFirstLaunch == null || isFirstLaunch == 'true') {
+ if (prefs.getBool('is_first_app_launch') ?? true) {
await _storage.deleteAll();
- await _storage.write(key: 'is_first_app_launch', value: 'false');
+
+ await prefs.setBool('is_first_app_launch', false);
}
}
diff --git a/comwell_key_app/pubspec.yaml b/comwell_key_app/pubspec.yaml
index 71246a0e..826ec57c 100644
--- a/comwell_key_app/pubspec.yaml
+++ b/comwell_key_app/pubspec.yaml
@@ -54,6 +54,7 @@ dependencies:
package_info_plus: ^8.3.0
sentry_flutter: ^8.13.0
share_plus: ^10.1.4
+ shared_preferences: ^2.5.3
dependency_overrides:
#Remove override when slider button updates