Repository navigation
Desktop (Windows/Linux) support #51
Description
Activity
A workaround, for now, would be to create a Flutter bridge and call a Native SDK via FFI, eg, Rust SDK
Is there anything planned in regard to this?
I would like to switch to this plugin but I need desktop support.Reacted by Muragijimana, Trevin Miller, StarProxima and Stéphane Archer@CaptainDario unfortunately not yet, but please upvote for gathering interest.
We'd need to write a pure Dart SDK (not depending on the Native SDKs such as Android and iOS for Desktop) or embed a Native SDK for Desktop, such as the Rust SDK.
However, adding macOS support should be easier since the iOS SDK supports a macOS target.
Which targets do you need? Win/Lin/macOS or all of them?
Thank you for the quick response! I upvoted this issue.
I would need support for all platforms. But I also see quite an opportunity in supporting these platforms for this package. Because firebase does not support desktop, and everybody needing desktop support will look somewhere else (just like me)
Reacted by Manoel Aranda Neto, InfoFlow and MuragijimanaA quick workaround, for now, is to just call the API directly until we provide first-class support for Flutter Desktop.
Reacted by dariyooo, InfoFlow and Satvik PendemI totally missed the direct API access, this seems like a good solution.
@marandaneto How can I overwrite the default timestamp?
When I try to set it the events are not registered anymore in the web UI.This works and the event is registered in the UI
Map response = jsonDecode((await http.post( Uri.parse('https://eu.posthog.com/capture/'), headers: { "Content-Type": "application/json", }, body: jsonEncode({ "api_key": Env.POSTHOG_API_KEY, "event": eventName, "properties" : completeProps, //"timestamp" : DateTime(2023, 10, 5).toIso8601String(), }) )).body);
this even is not registered.
Map response = jsonDecode((await http.post( Uri.parse('https://eu.posthog.com/capture/'), headers: { "Content-Type": "application/json", }, body: jsonEncode({ "api_key": Env.POSTHOG_API_KEY, "event": eventName, "properties" : completeProps, "timestamp" : DateTime(2023, 10, 5).toIso8601String(), }) )).body);
However, in both cases, the return value is
"{status: 1}".
Do you have an idea how to overwrite it?Edit: It works I had the time filters set to 24h.
For anybody finding this, the current time can be set with
(DateTime.now().toUtc()).toIso8601String().For anybody finding this, the current time can be set with
(DateTime.now().toUtc()).toIso8601String().Yes, the docs mention the ISO8601 format.
Yes, the format is mentioned, but they did not mention (or I did not see) that the time needs to be normalized to UTC. When sending my time zone (UTC+1), the server did not return an error, it sent the same response as with UTC but the data was not visible in the dashboard.
If this is obvious, I am sorry to spam this issue, I thought somebody else may have the same problems.
Reacted by Manoel Aranda NetomacOS support has landed at least https://github.com/PostHog/posthog-flutter/releases/tag/4.0.0-beta.2
Reacted by dariyooo and bauwaerterReacted by dariyoooI hope to see a Windows version even if it's a quick and dirty version with helpers that call the API directly.
Reacted by Anton Iankin, Kyrylo K., InfoFlow, StarProxima, Ahmed UA and Stéphane Archer1 remaining item
I've put together a quick 'n dirty posthog dart client https://github.com/necodeIT/posthog_dart for anyone interested
Reacted by Luis Carrasco, InfoFlow, Robert Felker, Patt O'Brien and Satvik Pendemis there a way to gracefully turn off posthog on unsupported platforms such as linux?
i have a codebase which i run for web (in production) and linux (for testing), so i'm happy with just the web support. but when i run on linux i get errors like:
[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: MissingPluginException(No implementation found for method screen on channel posthog_flutter) #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:368:7) <asynchronous suspension> #1 PosthogFlutterIO.screen (package:posthog_flutter/src/posthog_flutter_io.dart:60:7) <asynchronous suspension> #2 _ProgrammerScreenState.initState (package:bodybuild/ui/programmer/page/programmer.dart:227:5) <asynchronous suspension>i have tried a patch like:
await Posthog().setup(config); + if (!kIsWeb) { + await Posthog().disable(); + } +but that just results in a black screen when i start the app on linux.
the only "solution" i see is wrapping every single call to Posthog()... with an kIsWeb check, obviously that's quite messy and i want to avoid that.
re https://posthog.com/questions/flutter-sdk-disable-for-unsupported-targets
@Dieterbe I think we have to have a NoOp at least so it does nothing on Linux and WindowReacted by Muragijimana@marandaneto wow! this looks good. i was thinking that we'd manually set the no-op mode based on the platform, but doing it automatically works even better I think.
Reacted by Manoel Aranda NetoIt's so weird. On your website you claim you ship fast. But you could not ship a Windows Desktop support in 3 years?
Reacted by Cihat ImamogluReacted by asdiujvaosidujdposiadjapoijIt's so weird. On your website you claim you ship fast. But you could not ship a Windows Desktop support in 3 years?
That's a matter of prioritization and not speed of shipping
PostHog has support for many products, and a wide range of SDKs https://posthog.com/docs/libraries
Implementing this requires implementing a new SDK (pure Dart SDK?) that works across Win/Linux, since this is just a wrapper on top of Android/Apple/Web
Or try to compile another SDK for those platforms eg .NET SDK, Rust, Pure Java, etc, since they work across all platforms.Happy to review PRs btw!
If you have a rust SDK can't you just use it and just forward the calls using dart? Also, can't it just call the Rest API directly?
I currently use a competitor product because of the lack of windows support on your side, I'm really interested in using your product instead. it's sad that your priorities doesn't match my need. I personally think windows support is a huge opportunity regarding dart desktop app (usually phone app with a window version)
@stephane-archer #170 (comment)
A Rust SDK already exists, but it's stateless (for backend use). We'd need to adapt and add a stateful mode as well, similar to our Node and RN SDKs, which share a core module.@marandaneto Thanks for the clarification, and apologies if I’m missing something here. I understand that a stateful implementation would be needed to support the full feature set. That said, would it be possible to expose at least part of the functionality using the current Rust SDK as it stands?
Even partial Windows support would already be a meaningful step forward for us and might be sufficient to justify switching.
#313 is a great start, no testing at all, just using claude do its best for now but its a PoC
Reacted by Kris Braun, Bruno Viana de Siqueira, wavyluv and Marcus Twichelany updates ?
Reacted by wavyluv and SynkcReacted by wavyluv and Synkcany updates ?
sorry we've not prioritized this yet, we'll be having a new planning tomorrow and i'll get you an update if its something we're gonna do soon
any updates ?
sorry we've not prioritized this yet, we'll be having a new planning tomorrow and i'll get you an update if its something we're gonna do soon
Hello, do you have any updates on prioritization?
Hello, do you have any updates on prioritization?
hey there! we're currently reviewing #621 as a resolution for this. feel free to leave feedback if you try it out 🙌
Reacted by Ivan Radonov and Synkc
https://posthog.com/questions/flutter-for-windows-support
https://posthoghelp.zendesk.com/agent/tickets/16890 (moved to PostHog: https://us.posthog.com/project/2/support/tickets/20254)
The Flutter SDK depends on the Android and iOS SDK.
Ideally, the SDK would also have a pure Dart client that works on Desktop or we should embed a Native SDK for Desktop such as the Rust SDK.
macOS is supported already.