Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Basic Push Notifications Service #518

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

Antonwy
Copy link
Contributor

@Antonwy Antonwy commented Nov 29, 2022

Push Notification Class

This class should handle everything related to Push Notifications, such as registering device Token, handling background notifications, and generating private & public keys.
Can be accessed as a singleton with PushNotifications.shared.

Crypto Export Manager

CryptoExportManager is a helper class that helps encode public and private keys to be used outside of iOS.
Link: https://github.com/DigitalLeaves/CryptoExportImportManager

Campus Backend

Initialises a gRPC client as a singleton.

Campus Service

New AppDelegate

  • Implements Push Notification Permission Request
  • Implements didFinishLaunch app callback to register device id in the backend
  • Implements Background Notification Handler
    func application(
    _ application: UIApplication,
    didReceiveRemoteNotification userInfo: [AnyHashable : Any],
    fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
    ) {
    Task {
    do {
    try await PushNotifications.shared.handleBackgroundNotification(data: userInfo)
    completionHandler(.noData)
    } catch {
    completionHandler(.failed)
    }
    }
    }

New Notification Service

This Service handles the decryption of push notifications before they are displayed to the user.
Requests the private key of the user from the keychain and tries to decrypt the notifications title, subtitle and body,

philippzagar and others added 2 commits November 24, 2022 22:17
* Fix/widget and movie bugs (#511)

* change tabbar items of Widgets & Grades to "outline"

* change studyroom widget icon

* bugfix: show events on same day -> filter past events out before building dict

* Improve MovieCard Design

* Update Version Number

* Make Widgets only available on phone

* Fix/token permissions UI (#512)

* Adding a new warning if not all permissions are granted.

* Spacers and Localizables

* bugfix: fix tower image (#509)

Closes #508

* Design/login (#513)

* Move Calendar Picker to bottom

* Rename Widget Tabbaritem

* Make LecturesView icons outline

* LectureView: reduce Lecture Info Text sizes

* Remove Calendar EventsView

* Fix Movie Title Image gray bar

* - fix TUM logo white pixelation
- calendar picker back to top

* Redesign some stuff for the Login Process

* Remove old tum logo_white images

* A few Login Design changes

* Add Need Help Button to Check Permissions View

* Remove red x from Check Token Button

* Add personal NavigationTitle to Widget View

* Today Btn press in Calendar forwards to day view

* Adjust Login Design to iPad

* Localize Mensa Garching traffic

* Remove icon from Semester List Group Header on Grades & Lectures

* Adjust Grades Info Design to Lectures (-> icon outline, text larger)

* LectureDetails: Add contact btn to lecturer info

* Change Lecturer Search Icon

* Widget View: await name to display navigationTitle

* Add Spacer to Widget Detail sheet top

* Change color check token permission view text

* Open Widget View when logging in

* Generate personalized Widget Navigation Title

* Reorder Code Widget Screen

* Adjust Profile "GET IN CONTACT" Btns to Webview setting

* Move NavTitle loading into recommender loading

* remove request location always use

* A few Login - Token Design changes

Co-authored-by: August Wittgenstein <75639931+AW-tum@users.noreply.github.com>
Co-authored-by: August Wittgenstein <august.wittgenstein@tum.de>
Co-authored-by: 14slash12 <59373377+14slash12@users.noreply.github.com>
Co-authored-by: Thomas Schuster <82888998+twihno@users.noreply.github.com>
@Antonwy Antonwy changed the base branch from main to development December 13, 2022 13:36
@Antonwy Antonwy marked this pull request as ready for review January 25, 2023 16:02
philippzagar
philippzagar previously approved these changes Jan 27, 2023
Copy link
Member

@philippzagar philippzagar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Only minor feedback regarding development artifacts, safer and better-structured code

Campus-iOS/AppDelegate.swift Outdated Show resolved Hide resolved
Campus-iOS/Base/Networking/CampusBackend.swift Outdated Show resolved Hide resolved
Campus-iOS/Campus-iOS.entitlements Show resolved Hide resolved
NotificationService/NotificationService.swift Outdated Show resolved Hide resolved
NotificationService/NotificationService.swift Outdated Show resolved Hide resolved
NotificationService/NotificationService.swift Outdated Show resolved Hide resolved
Campus-iOS/PushNotifications/PushNotifications.swift Outdated Show resolved Hide resolved
NotificationService/NotificationService.swift Outdated Show resolved Hide resolved
Antonwy and others added 4 commits January 29, 2023 15:25
* Fix/widget and movie bugs (#511)

* change tabbar items of Widgets & Grades to "outline"

* change studyroom widget icon

* bugfix: show events on same day -> filter past events out before building dict

* Improve MovieCard Design

* Update Version Number

* Make Widgets only available on phone

* Fix/token permissions UI (#512)

* Adding a new warning if not all permissions are granted.

* Spacers and Localizables

* bugfix: fix tower image (#509)

Closes #508

* Design/login (#513)

* Move Calendar Picker to bottom

* Rename Widget Tabbaritem

* Make LecturesView icons outline

* LectureView: reduce Lecture Info Text sizes

* Remove Calendar EventsView

* Fix Movie Title Image gray bar

* - fix TUM logo white pixelation
- calendar picker back to top

* Redesign some stuff for the Login Process

* Remove old tum logo_white images

* A few Login Design changes

* Add Need Help Button to Check Permissions View

* Remove red x from Check Token Button

* Add personal NavigationTitle to Widget View

* Today Btn press in Calendar forwards to day view

* Adjust Login Design to iPad

* Localize Mensa Garching traffic

* Remove icon from Semester List Group Header on Grades & Lectures

* Adjust Grades Info Design to Lectures (-> icon outline, text larger)

* LectureDetails: Add contact btn to lecturer info

* Change Lecturer Search Icon

* Widget View: await name to display navigationTitle

* Add Spacer to Widget Detail sheet top

* Change color check token permission view text

* Open Widget View when logging in

* Generate personalized Widget Navigation Title

* Reorder Code Widget Screen

* Adjust Profile "GET IN CONTACT" Btns to Webview setting

* Move NavTitle loading into recommender loading

* remove request location always use

* A few Login - Token Design changes

* Add compiler directive that disables Crashlytics for development (#520)

* Simple Crashlytics Service (#522)

* implemented simple `CrashlyticsService`

* replaced existing crashlytics usage

---------

Co-authored-by: August Wittgenstein <75639931+AW-tum@users.noreply.github.com>
Co-authored-by: August Wittgenstein <august.wittgenstein@tum.de>
Co-authored-by: 14slash12 <59373377+14slash12@users.noreply.github.com>
Co-authored-by: Thomas Schuster <82888998+twihno@users.noreply.github.com>
Co-authored-by: Anton Wyrowski <anton.wyrowski@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants