From 6355178545e9b856287f9b1ce89837bcd56f16fc Mon Sep 17 00:00:00 2001 From: Maximilian Clarke Date: Tue, 6 Feb 2024 15:09:19 +1000 Subject: [PATCH] Update names --- PostHog/PostHogSDK.swift | 6 +++--- PostHogTests/PostHogSDKTest.swift | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/PostHog/PostHogSDK.swift b/PostHog/PostHogSDK.swift index a386b8e35..4be59163d 100644 --- a/PostHog/PostHogSDK.swift +++ b/PostHog/PostHogSDK.swift @@ -696,16 +696,16 @@ private let sessionChangeThreshold: TimeInterval = 60 * 30 object: nil) #elseif os(macOS) defaultCenter.addObserver(self, - selector: #selector(handleAppOpened), + selector: #selector(handleAppDidFinishLaunching), name: NSApplication.didFinishLaunchingNotification, object: nil) // macOS does not have didEnterBackgroundNotification, so we use didResignActiveNotification defaultCenter.addObserver(self, - selector: #selector(captureAppBackgrounded), + selector: #selector(handleAppDidEnterBackground), name: NSApplication.didResignActiveNotification, object: nil) defaultCenter.addObserver(self, - selector: #selector(handleAppOpened), + selector: #selector(handleAppDidBecomeActive), name: NSApplication.didBecomeActiveNotification, object: nil) #endif diff --git a/PostHogTests/PostHogSDKTest.swift b/PostHogTests/PostHogSDKTest.swift index e087185d9..d504a97a6 100644 --- a/PostHogTests/PostHogSDKTest.swift +++ b/PostHogTests/PostHogSDKTest.swift @@ -301,7 +301,7 @@ class PostHogSDKTest: QuickSpec { it("capture AppInstalled") { let sut = self.getSut() - sut.handleAppStarted() + sut.handleAppDidBecomeActive() let events = getBatchedEvents(server) @@ -324,7 +324,7 @@ class PostHogSDKTest: QuickSpec { userDefaults.setValue("1", forKey: "PHGBuildKeyV2") userDefaults.synchronize() - sut.handleAppStarted() + sut.handleAppDidBecomeActive() let events = getBatchedEvents(server) @@ -344,7 +344,7 @@ class PostHogSDKTest: QuickSpec { it("capture AppOpenedFromBackground from_background should be false") { let sut = self.getSut() - sut.handleAppOpened() + sut.handleAppDidBecomeActive() let events = getBatchedEvents(server) @@ -361,8 +361,8 @@ class PostHogSDKTest: QuickSpec { it("capture AppOpenedFromBackground from_background should be true") { let sut = self.getSut(flushAt: 2) - sut.handleAppOpened() - sut.handleAppOpened() + sut.handleAppDidBecomeActive() + sut.handleAppDidBecomeActive() let events = getBatchedEvents(server) @@ -379,7 +379,7 @@ class PostHogSDKTest: QuickSpec { it("capture captureAppOpened") { let sut = self.getSut() - sut.handleAppOpened() + sut.handleAppDidBecomeActive() let events = getBatchedEvents(server)