-
Notifications
You must be signed in to change notification settings - Fork 11
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
Propose for 0.4.1 improvements #13
base: main
Are you sure you want to change the base?
Conversation
Avoiding calling `unawaited` every time you want to track a new event. The lint rule: https://dart.dev/tools/linter-rules/unawaited_futures
… latest flutter version Warning: In index.html:37: Local variable for "serviceWorkerVersion" is deprecated. Use "{{flutter_service_worker_version}}" template token instead. See https://docs.flutter.dev/platform-integration/web/initialization for more details. Warning: In index.html:46: "FlutterLoader.loadEntrypoint" is deprecated. Use "FlutterLoader.load" instead. See https://docs.flutter.dev/platform-integration/web/initialization for more details.
Great and veeerrrryyy important change. The big issue about the approach before is that you set the message handler to your method for the whole app. The rest of the app will not be able to receive app lifecycle events. |
Indeed. I realized one day after merged 😔 What else can you comment? |
Thats unfortunate 😞
I just realized it when we had this bug in one of our apps. I was thinking "Why can't I receive lifecycle events" until we bruteforce-removed every plugin until we knew it was aptabase 😆
What do you mean? Feedback for the rest of the code? 😄 |
Quoting changelog.md
1. Lifecycle issue
The PR #8 is working as should
but now I need to listen the flutter's lifecycle in my app (not in aptabase's package) and since the package already is doing that and as documented on
SystemChannels.lifecycle
:we would lose the feature "send events when app goes to background".
And I've found out the SystemChannels.lifecycle has other unwanted side effects in general.
2. Changed
trackEvent
to not futureI use the
unawaited_futures
lint rule so I should add theunawaited
every time I want to track and already create a caller just to wrap it. Thinking in other users and in this lint, changed it to not future anymore.The problem here is if the dev already implemented either
await
orunawaited
when calling thetrackEvents
, it'd be an error (as it is not future anymore) and will break (so shouldn't be only minor bump 0.4.1). I prefer to avoid that.One solution would be implement another caller as not future and (maybe) add a deprecated in future caller.
I really want to hear you about that before.
3. Fix web info
In web is flagging OS as unknown.
In package DeviceInfoPlugin has the implementation for web platform, check out in pub.dev example
Already change to use the
webBrowserInfo
The issue here is the
version
part as the web provides not a clear single option to use.In documentation has these info:
Here is my debug value:
We could use the
appVersion
but still not so clear and simple.And yet we should limit it to 100 max chars as server defined.
39:
osInfo.version.substring(0, 100),
Again I want to know what your opinion before move on.
Sorry for long message but want to discuss before open the PR itself and also if you want to, I can break the PRs in 1,2,3 parts if you'd prefer.