NotificationController.swift 1023 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // NotificationController.swift
  3. // Firestore_Example_watchOS WatchKit Extension
  4. //
  5. // Created by Cheryl Lin on 2022-06-08.
  6. // Copyright © 2022 Google. All rights reserved.
  7. //
  8. import WatchKit
  9. import SwiftUI
  10. import UserNotifications
  11. class NotificationController: WKUserNotificationHostingController<NotificationView> {
  12. override var body: NotificationView {
  13. return NotificationView()
  14. }
  15. override func willActivate() {
  16. // This method is called when watch view controller is about to be visible to user
  17. super.willActivate()
  18. }
  19. override func didDeactivate() {
  20. // This method is called when watch view controller is no longer visible
  21. super.didDeactivate()
  22. }
  23. override func didReceive(_ notification: UNNotification) {
  24. // This method is called when a notification needs to be presented.
  25. // Implement it if you use a dynamic notification interface.
  26. // Populate your dynamic notification interface as quickly as possible.
  27. }
  28. }