Skip to content

feat(posthog): add getSessionId method for iOS and Android #437

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 7 commits into from

Conversation

Pama-Lee
Copy link

Change Reasons

This feature adds the ability to retrieve the current PostHog session ID from both iOS and Android platforms. Session ID is crucial for tracking user sessions and connecting events that occur within the same session, allowing developers to implement more advanced analytics and debugging capabilities.

Pull request checklist

Please check if your PR fulfills the following requirements:

  • The changes have been tested successfully.
  • A changeset has been created (npm run changeset).
  • I have read and followed the pull request guidelines.

@Pama-Lee Pama-Lee requested a review from robingenz February 26, 2025 03:56
Copy link
Member

@robingenz robingenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last thing: Please create a changeset by running npm run changeset.

@Pama-Lee Pama-Lee requested a review from robingenz February 28, 2025 12:46
Copy link
Member

@robingenz robingenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Member

@robingenz robingenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Actions workflow failed. Please fix the build and format the code (npm run fmt).

@Pama-Lee
Copy link
Author

@robingenz
Sorry, forgot to run fmt before the commit. The issue was that the sessionId returned by the PostHog JS in the Android part was a UUID object instead of a string. I’ve fixed it and it has passed fmt now.

@Pama-Lee Pama-Lee requested a review from robingenz February 28, 2025 13:05
Copy link
Member

@robingenz robingenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pama-Lee It's still failing:

@capawesome/capacitor-posthog:lint: Checking formatting...
@capawesome/capacitor-posthog:lint: [warn] jsxBracketSameLine is deprecated.
@capawesome/capacitor-posthog:lint: [warn] android/src/main/java/io/capawesome/capacitorjs/plugins/posthog/classes/results/GetSessionIdResult.java
@capawesome/capacitor-posthog:lint: [warn] src/definitions.ts
@capawesome/capacitor-posthog:lint: [warn] Code style issues found in 2 files. Run Prettier with --write to fix.

@robingenz robingenz changed the title feat: add getSessionId method for iOS and Android feat(posthog): add getSessionId method for iOS and Android Mar 14, 2025
@robingenz
Copy link
Member

@Pama-Lee If you are still interested in contributing this feature, please merge the latest changes of main and fix the GitHub action workflow.

@robingenz robingenz closed this Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants