Skip to content
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

chore: android plugin #1

Merged
merged 13 commits into from
Sep 18, 2024
Merged

chore: android plugin #1

merged 13 commits into from
Sep 18, 2024

Conversation

marandaneto
Copy link
Member

@marandaneto marandaneto commented Sep 18, 2024

pinned all the versions that make it work with the other plugins https://github.com/PostHog/posthog-js-lite/tree/main/posthog-react-native
ios is next but should be more straight forward

@marandaneto marandaneto requested a review from a team September 18, 2024 07:46
Comment on lines +3 to +4
PosthogReactNativeSessionReplay_targetSdkVersion=34
PosthogReactNativeSessionReplay_compileSdkVersion=34
Copy link

Choose a reason for hiding this comment

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

I remember messing with sdk versions was always messy given how fragmented Android was as an ecosystem. I assume the target / compile versions are less important than changing something like the minSdkVersion?

Copy link
Member Author

Choose a reason for hiding this comment

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

they are equally important, if you dont compile and target the newest versions, your app can't even ben released in the stores.
this is just a fallback though, in case its not provided by the "final app"

Comment on lines +29 to +62
// OptionalReactNativeSessionReplay.isEnabled().then((isEnabled) => {
// console.warn('PostHog Debug', `isEnabled: ${isEnabled}`);
// setResult(isEnabled.valueOf().toString());
// });
// OptionalReactNativeSessionReplay.startSession(
// 'e58ed763-928c-4155-bee9-fdbaaadc15f3'
// )
// .then(() => {
// setResult('ok');
// })
// .catch(() => {
// setResult('failed');
// });
// OptionalReactNativeSessionReplay.start(
// 'e58ed763-928c-4155-bee9-fdbaaadc15f3',
// {
// apiKey: 'phc_QFbR1y41s5sxnNTZoyKG2NJo2RlsCIWkUfdpawgb40D',
// host: 'https://us.i.posthog.com',
// },
// {},
// {}
// )
// .then(() => {
// OptionalReactNativeSessionReplay?.isEnabled().then((isEnabled) => {
// console.warn('PostHog Debug', `isEnabled: ${isEnabled}`);
// setResult(`isEnabled: ${isEnabled}`);
// });
// })
// .then(() => {
// setResult('ok');
// })
// .catch(() => {
// setResult('failed');
// });
Copy link

Choose a reason for hiding this comment

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

Suggested change
// OptionalReactNativeSessionReplay.isEnabled().then((isEnabled) => {
// console.warn('PostHog Debug', `isEnabled: ${isEnabled}`);
// setResult(isEnabled.valueOf().toString());
// });
// OptionalReactNativeSessionReplay.startSession(
// 'e58ed763-928c-4155-bee9-fdbaaadc15f3'
// )
// .then(() => {
// setResult('ok');
// })
// .catch(() => {
// setResult('failed');
// });
// OptionalReactNativeSessionReplay.start(
// 'e58ed763-928c-4155-bee9-fdbaaadc15f3',
// {
// apiKey: 'phc_QFbR1y41s5sxnNTZoyKG2NJo2RlsCIWkUfdpawgb40D',
// host: 'https://us.i.posthog.com',
// },
// {},
// {}
// )
// .then(() => {
// OptionalReactNativeSessionReplay?.isEnabled().then((isEnabled) => {
// console.warn('PostHog Debug', `isEnabled: ${isEnabled}`);
// setResult(`isEnabled: ${isEnabled}`);
// });
// })
// .then(() => {
// setResult('ok');
// })
// .catch(() => {
// setResult('failed');
// });

Copy link
Member Author

Choose a reason for hiding this comment

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

I'd rather keep it since it's for testing the native calls (during development - its just a sample), ideally I'd have a button for each of them, will do it in the next PR with iOS if that's ok

@marandaneto marandaneto merged commit ba07b2e into main Sep 18, 2024
4 of 5 checks passed
@marandaneto marandaneto deleted the chore/android-plugin branch September 18, 2024 11:24
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