Skip to content

Commit

Permalink
feat: support single-target Watch applications
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidharris committed May 13, 2024
1 parent f446396 commit ce2c5d6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/Amplitude/Plugins/watchOS/WatchOSLifecycleMonitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
class WatchOSLifecycleMonitor: UtilityPlugin {
var wasBackgrounded: Bool = false

private var watchExtension = WKExtension.shared()
private var watchExtension = WKApplication.shared()
private var appNotifications: [NSNotification.Name] = [
WKExtension.applicationWillEnterForegroundNotification,
WKExtension.applicationDidEnterBackgroundNotification,
WKApplication.willEnterForegroundNotification,
WKApplication.didEnterBackgroundNotification,
]

override init() {
watchExtension = WKExtension.shared()
watchExtension = WKApplication.shared()
super.init()
setupListeners()
}

@objc
func notificationResponse(notification: NSNotification) {
switch notification.name {
case WKExtension.applicationWillEnterForegroundNotification:
case WKApplication.willEnterForegroundNotification:
self.applicationWillEnterForeground(notification: notification)
case WKExtension.applicationDidEnterBackgroundNotification:
case WKApplication.didEnterBackgroundNotification:
self.applicationDidEnterBackground(notification: notification)
default:
break
Expand Down

0 comments on commit ce2c5d6

Please sign in to comment.