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

Flutter Session Recordings (Android/iOS) #69

Open
marandaneto opened this issue Jan 2, 2024 · 20 comments · Fixed by PostHog/posthog-js#1082
Open

Flutter Session Recordings (Android/iOS) #69

marandaneto opened this issue Jan 2, 2024 · 20 comments · Fixed by PostHog/posthog-js#1082
Labels
enhancement New feature or request Replay

Comments

@marandaneto
Copy link
Member

marandaneto commented Jan 2, 2024

Description

PostHog/posthog#12344 (comment)
People also asked on the slack community channel.

Related issue PostHog/posthog#13267 and PostHog/posthog#12344

Related Flutter issues
flutter/flutter#129098
flutter/flutter#66863
flutter/flutter#117382

@marandaneto marandaneto added enhancement New feature or request Replay labels Jan 2, 2024
@Kiruel
Copy link
Contributor

Kiruel commented Jan 31, 2024

Do you think we can already use it in a Web environment via:
https://posthog.com/docs/session-replay/installation#add-to-your-website-and-product

If we add this script can we already got session record in Web ?
Thanks,

@marandaneto
Copy link
Member Author

Do you think we can already use it in a Web environment via: posthog.com/docs/session-replay/installation#add-to-your-website-and-product

If we add this script can we already got session record in Web ? Thanks,

That has to be tested, I am unsure, it might work for the html renderer but not for canvaskit I guess.
Maybe the canvaskit renderer requires canvas support which is in BETA yet.

Would you like to give it a try?

@Kiruel
Copy link
Contributor

Kiruel commented Feb 1, 2024

I'm using rudderstack to handle posthog, see rudderlabs/rudder-sdk-flutter#151 for more info.

@Kiruel
Copy link
Contributor

Kiruel commented Feb 9, 2024

I was able to use session recording, with the JS configuration. But I got some white background on the session record event with the Capture canvas elements enabled.

Using flutter build web --web-renderer canvaskit or flutter build web --web-renderer html change nothing. So I see some click/textinput but with with background. (so can't see the text white etc...).

@marandaneto
Copy link
Member Author

@Kiruel can you share your JS configuration?
@daibhin would be interested in checking this out.

@marandaneto
Copy link
Member Author

@Kiruel which version of the JS SDK have you tried? there was a bug fixed in this version, not sure if related though.

@daibhin
Copy link

daibhin commented Feb 12, 2024

@Kiruel I would certainly like to look into this more for you. Could you send a report using the in-app support form with a link to the problematic recording and I can take a closer look.

@Kiruel
Copy link
Contributor

Kiruel commented Feb 12, 2024

I'm using the SDK rudderstack, to send session recording. With the JS config for web env. I can send you all information in DM (slack?) or in the in-app form you send me.

@Kiruel
Copy link
Contributor

Kiruel commented Feb 12, 2024

I just send you the Ticket 10418. Thanks.

@marandaneto
Copy link
Member Author

@daibhin I can also reproduce this locally.
https://us.posthog.com/project/41706/replay/018dd001-6a18-7c6b-9b1b-e6f2559e32be
Just run flutter run -d chrome --web-renderer canvaskit on this folder https://github.com/PostHog/posthog-flutter/tree/main/example

@daibhin
Copy link

daibhin commented Mar 8, 2024

It's taken me a while to investigate this properly. It looks like Flutter wraps the canvas in a custom HTML element. I believe we are not correctly capturing the children of that element and hence ignoring the canvas. Seeing if there is a way around that, two ideas I'm exploring:

  • Allowing a different root to be set so we can skip the custom elements in the tree (feat: allow custom replay root posthog-js#1061). Not my favourite solution to expose that because we haven't needed it before now
  • Seeing if there is a way for rrweb to capture custom elements. Will dig on that a little further...

@marandaneto
Copy link
Member Author

Reopened because only the Flutter web session recording is supported right now.
This issue also tracks Android and iOS session recording support.

@marandaneto marandaneto changed the title Flutter Session Recordings Flutter Session Recordings (Android/iOS) Mar 19, 2024
@thisames
Copy link

thisames commented Aug 9, 2024

I believe that implementing a screen recording feature is not that complicated. The problem is doing this based on the listeners of the user's actions in the Flutter element tree. You would have to implement a track on the widget clicks and base the recording life cycle on that.

What is your idea? @marandaneto

@marandaneto
Copy link
Member Author

I believe that implementing a screen recording feature is not that complicated. The problem is doing this based on the listeners of the user's actions in the Flutter element tree. You would have to implement a track on the widget clicks and base the recording life cycle on that.

What is your idea? @marandaneto

Yes, but I wonder if we can leverage the Android and iOS SDK first (via native), using screenshot mode, so all happens in native, if possible.
The screen clicks, network, console logs, etc we can do through the Flutter bits on Dart.

@thisames
Copy link

I believe that implementing a screen recording feature is not that complicated. The problem is doing this based on the listeners of the user's actions in the Flutter element tree. You would have to implement a track on the widget clicks and base the recording life cycle on that.
What is your idea? @marandaneto

Yes, but I wonder if we can leverage the Android and iOS SDK first (via native), using screenshot mode, so all happens in native, if possible. The screen clicks, network, console logs, etc we can do through the Flutter bits on Dart.

Yes, it is possible to take advantage of native screen captures. We would just have to have a channel that communicates with Flutter's clicks to the native listeners. I'll try to make a demo to see if this really works.

@RCVZ
Copy link

RCVZ commented Aug 28, 2024

Over at Sentry, they are using toImage on a renderobject to get a screenshot.

getsentry/sentry-dart#2209

@Bruno-Meowtel
Copy link

Hi there! We're using the PostHog Flutter SDK in our Mobile app and were wondering if there's an estimated timeline for when Session Recordings might be available? Any insights would be greatly appreciated. Thanks!

@jonastg
Copy link

jonastg commented Sep 10, 2024

I am in the same situation as @Bruno-Meowtel. We are using PostHog in web and mobile app and we are very interested in to have this feature for mobile apps.

@swxdigital
Copy link

We are also looking for session replays for Flutter! Currently, when enabled we see a white screen for web recordings, with the cursor moving around and clicking. @Bruno-Meowtel @jonastg

@marandaneto
Copy link
Member Author

We are also looking for session replays for Flutter! Currently, when enabled we see a white screen for web recordings, with the cursor moving around and clicking. @Bruno-Meowtel @jonastg

@swxdigital please raise a new issue instead since this is about Android and iOS, and please share more context such as a recording link, browser, if you have canvas enabled in the project settings, etc.
cc @daibhin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Replay
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants