amplitude / Amplitude-iOS

Native iOS/tvOS/macOS SDK
MIT License
303 stars 193 forks source link

Fix: Don't report two app open events at initial launch #494

Closed crleona closed 6 months ago

crleona commented 6 months ago

Summary

UIApplicationWillEnterForegroundNotification fires both at initial launch and when returning from the background. Because we were using a different notification (UIApplicationDidFinishLaunchingNotification) to detect if the app open was from the background, we effectively were firing the event twice. Instead, rely on UIApplicationState to determine if we were opened from the background.

Checklist

github-actions[bot] commented 6 months ago

:tada: This PR is included in version 8.19.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: