hanabi1224 / flutter_appcenter_bundle

MIT License
21 stars 48 forks source link

Web support? #42

Open mikeesouth opened 3 years ago

mikeesouth commented 3 years ago

Any plans on supporting flutter for web?

hanabi1224 commented 3 years ago

Hmm, this package is a wrap-up of ms appcenter sdk, which does not seem to support web platform, so I don't think this is a valid feature request. You can create another package or re-use ms application insights api/sdk for js to get similar telemetry functionalities but that is beyond the scope of this package.

mikeesouth commented 3 years ago

@hanabi1224 ok, fair enough. I haven't read about it in detail so I'm not sure how it works. I closed the issue when I realised the same thing, i.e. that the appcenter sdk does not seem to support web apps. Then I realised that I can create apps with "custom" OS in the appcenter.ms portal so I thought: hey, why not? and I reopened this issue.

With Flutter for web being stable and increasing in popularity, many existing apps will "enable web support". When I did this with my app I faced a problem with this package. The problem was trivial, something like Platform.operatingSystem is not supported and there are workarounds for this, such as UniversalPlatform.operatingSystem (https://pub.dev/packages/universal_platform) but I assume that there will be more incompatibilities that may be more difficult to sort out.

However, if this would work it would be great to get usage and diagnostics data from the app to appcenter, from ios devices, android devices and web clients. As a flutter dev, I would appreciate packages to just work for all flutter platforms, even if the package just did a "no operation" on unsupported platforms.

hanabi1224 commented 3 years ago

@mikeesouth AFAIK, appcenter's telemetry functionality is built on top of azure application insights, for that part you can just switch to packages that are implemented in pure dart with all platforms supported. (like this one) Functionalities besides telemetry do not really make sense on a 'custom' platform and you can probably use the conditional import ability in dart lang to opt-in for mobile platforms (like this), does that make sense?

mikeesouth commented 3 years ago

Well, I guess it does but I would argue that diagnostics (exceptions) would be great to track even for web clients (i.e. 'custom os'). If I have a bug in my flutter code that could affect an Android user, an iOS user or a web user. The operating system is merely a window to my application. Furthermore, the automatic telemetry that appcenter provides (daily active users, users per version, languages, location etc) would be nice to gather into the same platform. I do not want to have two platforms send information to appcenter.ms and the third to send data to azure insights, even if appcenter.ms is built on top of insights. The better solution would be to switch all clients to azure_applications_insights package in that case.

But I do understand your point of view in this. I'm looking into switching to firebase analytics instead and that library have cross platform support for native and web apps - just what I'm looking for. However, firebase configuration is a bit messy unfortunately. What's even worse is that I do not get all exceptions in firebase when I report to both appcenter and firebase so it's not a full replacement to appcenter just yet (at least not for me).

I'm fine with closing this issue, thanks for your replies @hanabi1224.