Skip to content

Commit

Permalink
Fix app lifecycle code snippet for iOS (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
marandaneto authored Dec 6, 2023
1 parent 84df724 commit 15e2dc0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,19 @@ Remember that the application lifecycle events won't have any special context se
<string>YOUR_API_KEY_GOES_HERE</string>
<key>com.posthog.posthog.POSTHOG_HOST</key>
<string>https://app.posthog.com</string>
<key>com.posthog.posthog.TRACK_APPLICATION_LIFECYCLE_EVENTS</key>
<key>com.posthog.posthog.CAPTURE_APPLICATION_LIFECYCLE_EVENTS</key>
<false/>
[...]
</dict>
</plist>
```

For `debug` mode on iOS, you can use the following snippet:

```dart
PostHog().debug(true);
```

### Web

```html
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.posthog.posthog_flutter_example"
minSdkVersion 19
minSdkVersion 23
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName

Expand Down
3 changes: 2 additions & 1 deletion example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@
on if you wish the library to take care of it for you.
Remember that the application lifecycle events won't have any
special context set for you by the time it is initialized. -->
<meta-data android:name="com.posthog.posthog.API_KEY" android:value="YOUR_API_KEY_GOES_HERE" />
<meta-data android:name="com.posthog.posthog.API_KEY" android:value="_6SG-F7I1vCuZ-HdJL3VZQqjBlaSb1_20hDPwqMNnGI" />
<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="true" />
<!--
If you want to debug the plugin events. Default is false.
<meta-data android:name="com.posthog.posthog.DEBUG" android:value="true" />
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<string>https://app.posthog.com</string>
<key>com.posthog.posthog.API_KEY</key>
<string>YOUR_API_KEY_GOES_HERE</string>
<key>com.posthog.posthog.TRACK_APPLICATION_LIFECYCLE_EVENTS</key>
<key>com.posthog.posthog.CAPTURE_APPLICATION_LIFECYCLE_EVENTS</key>
<false/>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
Expand Down

0 comments on commit 15e2dc0

Please sign in to comment.