Adds these events that were present in v1. I put it behind an options flag, so that users will need to opt-in. This will prevent people from getting an unexpected surge of these events when updating the sdk.
Added an options flag captureNativeAppLifecycleEvents which, when set, will cause the SDK to automatically capture 'Application Installed', 'Application Updated', 'Application Opened', and 'Application Backgrounded'.
Problem
Fixes https://github.com/PostHog/posthog-js-lite/issues/107
~Note: please merge https://github.com/PostHog/posthog-js-lite/pull/109 first, as this depends upon that.~
Changes
Adds these events that were present in v1. I put it behind an options flag, so that users will need to opt-in. This will prevent people from getting an unexpected surge of these events when updating the sdk.
Note: I found that due to ignoring the returned promise on line https://github.com/PostHog/posthog-js-lite/blob/54178fc167362f550c7f5703f2931abc487f8134/posthog-react-native/src/posthog-rn.ts#L108 ,
initAsync
would return beforesetupAsync
had completed. This is something that is a bit awkward to get right, when there in a constructor which needs to do something async. I fixed this by storing the promise and awaiting it ininitAsync
.Release info Sub-libraries affected
Bump level
Libraries affected
Changelog notes
captureNativeAppLifecycleEvents
which, when set, will cause the SDK to automatically capture 'Application Installed', 'Application Updated', 'Application Opened', and 'Application Backgrounded'.