-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e17fb70
commit 07932d9
Showing
3 changed files
with
34 additions
and
66 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
Migration from v2 to v3 | ||
============ | ||
|
||
## Setup v2 | ||
|
||
```kotlin | ||
import com.posthog.PostHog | ||
|
||
val apiKey = "..." | ||
val posthog = PostHog.Builder(applicationContext, apiKey) | ||
.captureApplicationLifecycleEvents() | ||
captureDeepLinks() | ||
.recordScreenViews() | ||
.build() | ||
PostHog.setSingletonInstance(posthog) | ||
|
||
PostHog.with(applicationContext).capture("event") | ||
``` | ||
|
||
## Setup v3 | ||
|
||
```kotlin | ||
import com.posthog.PostHog | ||
import com.posthog.android.PostHogAndroid | ||
import com.posthog.android.PostHogAndroidConfig | ||
|
||
val apiKey = "..." | ||
val config = PostHogAndroidConfig(apiKey).apply { | ||
captureApplicationLifecycleEvents = true | ||
captureDeepLinks = true | ||
captureScreenViews = true | ||
} | ||
PostHogAndroid.setup(applicationContext, config) | ||
|
||
PostHog.capture("event") | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,10 +12,8 @@ else | |
echo "Going to push the changes." | ||
git config --global user.name 'PostHog Github Bot' | ||
git config --global user.email '[email protected]' | ||
git config pull.ff only | ||
git fetch | ||
git checkout ${GITHUB_BRANCH} | ||
git commit -am "Push changes" | ||
git merge --no-ff ${GITHUB_BRANCH} | ||
git commit -am "Update version" | ||
git push --set-upstream origin ${GITHUB_BRANCH} | ||
fi |