From 7b4c698a8e7d2f1d5a1e27c9045e44b585ed6cf2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Elias=20M=C3=BCller?= <elias@elias-mueller.com>
Date: Fri, 8 Sep 2023 22:43:22 +0200
Subject: [PATCH] Enabled Notification settings menu on iOS

---
 android/.idea/gradle.xml        |  1 -
 android/.idea/misc.xml          |  1 +
 android/.idea/workspace.xml     | 45 +++++++++++++--------------
 lib/view/settings/settings.dart | 55 ++++++++++++++++-----------------
 pubspec.yaml                    |  2 +-
 5 files changed, 49 insertions(+), 55 deletions(-)

diff --git a/android/.idea/gradle.xml b/android/.idea/gradle.xml
index d76bd6e..2fd211c 100644
--- a/android/.idea/gradle.xml
+++ b/android/.idea/gradle.xml
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="GradleMigrationSettings" migrationVersion="1" />
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml
index 8978d23..0ad17cb 100644
--- a/android/.idea/misc.xml
+++ b/android/.idea/misc.xml
@@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ExternalStorageConfigurationManager" enabled="true" />
   <component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
diff --git a/android/.idea/workspace.xml b/android/.idea/workspace.xml
index a42d006..d7d7a17 100644
--- a/android/.idea/workspace.xml
+++ b/android/.idea/workspace.xml
@@ -4,20 +4,17 @@
     <option name="autoReloadType" value="NONE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="d185c889-19e3-486b-80aa-2f551fbbba88" name="Changes" comment="">
+    <list default="true" id="f3f989f0-43e5-4472-9047-056356336421" name="Changes" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/gradle.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/app/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/app/build.gradle" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/build.gradle" beforeDir="false" afterPath="$PROJECT_DIR$/build.gradle" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/../pubspec.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../pubspec.yaml" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
     <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
     <option name="LAST_RESOLUTION" value="IGNORE" />
   </component>
-  <component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[/home/elias/.android/avd/Nexus_10_API_30.avd]" />
+  <component name="ExecutionTargetManager" SELECTED_TARGET="device_and_snapshot_combo_box_target[/home/elias/.android/avd/Pixel_XL_API_30.avd]" />
   <component name="ExternalProjectsData">
     <projectState path="$PROJECT_DIR$">
       <ProjectState />
@@ -31,29 +28,29 @@
   <component name="Git.Settings">
     <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
   </component>
-  <component name="ProjectId" id="2UtmFXmKArKTcR4c45DCpVbNIsQ" />
+  <component name="ProjectId" id="2V854goPeDsIyyh0YFJgYPjxQY0" />
   <component name="ProjectViewState">
     <option name="hideEmptyMiddlePackages" value="true" />
     <option name="showLibraryContents" value="true" />
   </component>
-  <component name="PropertiesComponent">{
-  &quot;keyToString&quot;: {
-    &quot;BundleExportedModule&quot;: &quot;android.app&quot;,
-    &quot;ExportBundle.BundlePathForandroid.app&quot;: &quot;/home/elias/projects/MarianumMobile/Client/android/app&quot;,
-    &quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.cidr.known.project.marker&quot;: &quot;true&quot;,
-    &quot;cidr.known.project.marker&quot;: &quot;true&quot;,
-    &quot;dart.analysis.tool.window.visible&quot;: &quot;false&quot;,
-    &quot;last_opened_file_path&quot;: &quot;/home/elias/upload-keystore.jks&quot;,
-    &quot;show.migrate.to.gradle.popup&quot;: &quot;false&quot;
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "BundleExportedModule": "android.app",
+    "ExportBundle.BundlePathForandroid.app": "/home/elias/projects/MarianumMobile/Client/android/app",
+    "RunOnceActivity.OpenProjectViewOnStart": "true",
+    "RunOnceActivity.ShowReadmeOnStart": "true",
+    "RunOnceActivity.cidr.known.project.marker": "true",
+    "cidr.known.project.marker": "true",
+    "dart.analysis.tool.window.visible": "false",
+    "last_opened_file_path": "/home/elias/upload-keystore.jks",
+    "show.migrate.to.gradle.popup": "false"
   },
-  &quot;keyToStringList&quot;: {
-    &quot;ExportApk.BuildVariants&quot;: [
-      &quot;release&quot;
+  "keyToStringList": {
+    "ExportApk.BuildVariants": [
+      "release"
     ]
   }
-}</component>
+}]]></component>
   <component name="RunManager">
     <configuration name="app" type="AndroidRunConfigurationType" factoryName="Android App">
       <module name="android.app.main" />
@@ -125,11 +122,11 @@
   <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
   <component name="TaskManager">
     <task active="true" id="Default" summary="Default task">
-      <changelist id="d185c889-19e3-486b-80aa-2f551fbbba88" name="Changes" comment="" />
-      <created>1693767147650</created>
+      <changelist id="f3f989f0-43e5-4472-9047-056356336421" name="Changes" comment="" />
+      <created>1694204676938</created>
       <option name="number" value="Default" />
       <option name="presentableId" value="Default" />
-      <updated>1693767147650</updated>
+      <updated>1694204676938</updated>
     </task>
     <servers />
   </component>
diff --git a/lib/view/settings/settings.dart b/lib/view/settings/settings.dart
index bc5642a..c354554 100644
--- a/lib/view/settings/settings.dart
+++ b/lib/view/settings/settings.dart
@@ -147,36 +147,33 @@ class _SettingsState extends State<Settings> {
 
             const Divider(),
 
-            Visibility(
-              visible: Platform.isAndroid,
-              child: ListTile(
-                leading: const CenteredLeading(Icon(Icons.notifications_active_outlined)),
-                title: const Text("Push-Benachrichtigungen aktivieren"),
-                subtitle: const Text("Lange tippen für mehr Informationen"),
-                trailing: Checkbox(
-                  value: settings.val().notificationSettings.enabled,
-                  onChanged: (e) {
-                    if(e!) {
-                      NotifyUpdater.enableAfterDisclaimer(settings).asDialog(context);
-                    } else {
-                      settings.val(write: true).notificationSettings.enabled = e;
-                    }
-                  },
-                ),
-                onLongPress: () => showDialog(context: context, builder: (context) => AlertDialog(
-                  title: const Text("Info über Push"),
-                  content: const SingleChildScrollView(child: Text(""
-                      "Aufgrund technischer Limitationen müssen Push-nachrichten über einen Externen Server - hier 'mhsl.eu' (Author dieser App) - erfolgen.\n\n"
-                      "Wenn Push aktiviert wird, werden deine Zugangsdaten und ein Token verschlüsselt an den Betreiber gesendet und von ihm unverschlüsselt gespeichert.\n\n"
-                      "Der extene Server verwendet die Zugangsdaten um sich maschinell in Nextcloud Talk anzumelden und via Websockets auf neue Nachrichten zu warten.\n\n"
-                      "Wenn eine neue Nachricht eintrifft wird dein Telefon via FBC-Messaging (Google Firebase Push) vom Externen Server benachrichtigt.\n\n"
-                      "Behalte im Hinterkopf, dass deine Zugangsdaten auf einem Externen Server gespeichert werden und dies trots bester Absichten ein Sicherheitsrisiko sein kann!"
-                  )),
-                  actions: [
-                    TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text("Zurück"))
-                  ],
-                )),
+            ListTile(
+              leading: const CenteredLeading(Icon(Icons.notifications_active_outlined)),
+              title: const Text("Push-Benachrichtigungen aktivieren"),
+              subtitle: const Text("Lange tippen für mehr Informationen"),
+              trailing: Checkbox(
+                value: settings.val().notificationSettings.enabled,
+                onChanged: (e) {
+                  if(e!) {
+                    NotifyUpdater.enableAfterDisclaimer(settings).asDialog(context);
+                  } else {
+                    settings.val(write: true).notificationSettings.enabled = e;
+                  }
+                },
               ),
+              onLongPress: () => showDialog(context: context, builder: (context) => AlertDialog(
+                title: const Text("Info über Push"),
+                content: const SingleChildScrollView(child: Text(""
+                    "Aufgrund technischer Limitationen müssen Push-nachrichten über einen Externen Server - hier 'mhsl.eu' (Author dieser App) - erfolgen.\n\n"
+                    "Wenn Push aktiviert wird, werden deine Zugangsdaten und ein Token verschlüsselt an den Betreiber gesendet und von ihm unverschlüsselt gespeichert.\n\n"
+                    "Der extene Server verwendet die Zugangsdaten um sich maschinell in Nextcloud Talk anzumelden und via Websockets auf neue Nachrichten zu warten.\n\n"
+                    "Wenn eine neue Nachricht eintrifft wird dein Telefon via FBC-Messaging (Google Firebase Push) vom Externen Server benachrichtigt.\n\n"
+                    "Behalte im Hinterkopf, dass deine Zugangsdaten auf einem Externen Server gespeichert werden und dies trots bester Absichten ein Sicherheitsrisiko sein kann!"
+                )),
+                actions: [
+                  TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text("Zurück"))
+                ],
+              )),
             ),
 
             const Divider(),
diff --git a/pubspec.yaml b/pubspec.yaml
index 68aea1a..5af5935 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -17,7 +17,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
 # In Windows, build-name is used as the major, minor, and patch parts
 # of the product and file versions while build-number is used as the build suffix.
-version: 0.0.2+23
+version: 0.0.2+24
 
 environment:
   sdk: '>3.0.0'