From 1d8fa7902e157daebb0f327590356b7bd969be36 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 11 Jan 2023 10:36:19 +0100 Subject: [PATCH] Display push notifications keys for debug purpose --- .../Tabs/Settings/PushNotificationsView.swift | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/IceCubesApp/App/Tabs/Settings/PushNotificationsView.swift b/IceCubesApp/App/Tabs/Settings/PushNotificationsView.swift index 56a6e243..a59cfcbb 100644 --- a/IceCubesApp/App/Tabs/Settings/PushNotificationsView.swift +++ b/IceCubesApp/App/Tabs/Settings/PushNotificationsView.swift @@ -48,6 +48,27 @@ struct PushNotificationsView: View { .listRowBackground(theme.primaryBackgroundColor) .transition(.move(edge: .bottom)) } + + Section { + VStack(alignment: .leading) { + Text("Auth key:") + Text(pushNotifications.notificationsAuthKeyAsKey.base64EncodedString()) + .font(.footnote) + .foregroundColor(.gray) + } + VStack(alignment: .leading) { + Text("Public key:") + Text(pushNotifications.notificationsPrivateKeyAsKey.publicKey.x963Representation.base64EncodedString()) + .font(.footnote) + .foregroundColor(.gray) + } + } header: { + Text("Keys information") + } footer: { + Text("Your notifications are sent through a proxy server and are encrypted using a public/private key pair that is stored only on your device. The public key is sent to the server, so it can encrypt your notifications so that only your device can decrypt them.") + } + .listRowBackground(theme.primaryBackgroundColor) + } .navigationTitle("Push Notifications") .scrollContentBackground(.hidden)