Skip to content

Commit

Permalink
improved examples
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto committed Jan 10, 2024
1 parent 716566c commit 74f6805
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Next

- Record the root view as `root ("/")` instead of not recording at all [#74](https://github.com/PostHog/posthog-flutter/pull/74)
- Record the root view as `root ('/')` instead of not recording at all [#74](https://github.com/PostHog/posthog-flutter/pull/74)
- Do not mutate the given properties when calling capture [#74](https://github.com/PostHog/posthog-flutter/pull/74)
- Thanks @lukepighetti for the [PR](https://github.com/PostHog/posthog-flutter/pull/66)!
- Fix `CAPTURE_APPLICATION_LIFECYCLE_EVENTS` typo for iOS [#74](https://github.com/PostHog/posthog-flutter/pull/74)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ Remember that the application lifecycle events won't have any special context se
</activity>
<meta-data android:name="com.posthog.posthog.API_KEY" android:value="YOUR_API_KEY_GOES_HERE" />
<meta-data android:name="com.posthog.posthog.POSTHOG_HOST" android:value="https://app.posthog.com" />
<meta-data android:name="com.posthog.posthog.TRACK_APPLICATION_LIFECYCLE_EVENTS" android:value="false" />
<meta-data android:name="com.posthog.posthog.DEBUG" android:value="false" />
<meta-data android:name="com.posthog.posthog.TRACK_APPLICATION_LIFECYCLE_EVENTS" android:value="true" />
<meta-data android:name="com.posthog.posthog.DEBUG" android:value="true" />
</application>
</manifest>
```
Expand All @@ -109,7 +109,7 @@ Remember that the application lifecycle events won't have any special context se
<key>com.posthog.posthog.POSTHOG_HOST</key>
<string>https://app.posthog.com</string>
<key>com.posthog.posthog.CAPTURE_APPLICATION_LIFECYCLE_EVENTS</key>
<false/>
<true/>
[...]
</dict>
</plist>
Expand Down
10 changes: 1 addition & 9 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,9 @@
android:value="https://app.posthog.com" />
<meta-data
android:name="com.posthog.posthog.TRACK_APPLICATION_LIFECYCLE_EVENTS"
android:value="false" />
android:value="true" />
<meta-data
android:name="com.posthog.posthog.DEBUG"
android:value="true" />
<!--
If you want to debug the plugin events. Default is false.
<meta-data android:name="com.posthog.posthog.DEBUG" android:value="true" />
Expected shell output (flutter run) when this flag is enabled:
D/Analytics(32684): Ran TrackPayload{event="ButtonClicked"} on integration Posthog.com in 480110 ns.
D/Analytics(32684): Ran TrackPayload{event="ButtonClicked"} on integration Posthog.com in 104410 ns.
-->
</application>
</manifest>
2 changes: 1 addition & 1 deletion example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
<key>com.posthog.posthog.API_KEY</key>
<string>_6SG-F7I1vCuZ-HdJL3VZQqjBlaSb1_20hDPwqMNnGI</string>
<key>com.posthog.posthog.CAPTURE_APPLICATION_LIFECYCLE_EVENTS</key>
<false/>
<true/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
Expand Down
2 changes: 2 additions & 0 deletions ios/Classes/PosthogFlutterPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ public class PosthogFlutterPlugin: NSObject, FlutterPlugin {

let host = Bundle.main.object(forInfoDictionaryKey: "com.posthog.posthog.POSTHOG_HOST") as? String ?? PostHogConfig.defaultHost
let postHogCaptureLifecyleEvents = Bundle.main.object(forInfoDictionaryKey: "com.posthog.posthog.CAPTURE_APPLICATION_LIFECYCLE_EVENTS") as? Bool ?? false
let postHogDebug = Bundle.main.object(forInfoDictionaryKey: "com.posthog.posthog.DEBUG") as? Bool ?? false

let config = PostHogConfig(
apiKey: apiKey,
host: host
)
config.captureApplicationLifecycleEvents = postHogCaptureLifecyleEvents
config.debug = postHogDebug
config.captureScreenViews = false

// Update SDK name and version
Expand Down

0 comments on commit 74f6805

Please sign in to comment.