istornz / flutter_live_activities

A Flutter plugin to use iOS 16.1+ Live Activities ⛹ī¸ & iPhone Dynamic Island 🏝ī¸ features
https://dimitridessus.fr/
MIT License
161 stars 48 forks source link

Fixes background thread invocation of event streams #82

Closed ggirotto closed 3 months ago

ggirotto commented 3 months ago

I'm facing the following issue in production app:

[ERROR:flutter/shell/common/shell.cc(1038)] The 'live_activities/activity_status' channel sent a message from native to Flutter on a non-platform thread. Platform channel messages must be sent on the platform thread. Failure to do so may result in data loss or crashes, and must be fixed in the plugin or application code creating that channel.

I'm not sure which invocation of the stream is causing this, but just in case I added main thread execution wrapping all invocations of the method. Let me know if you disagree.

istornz commented 3 months ago

LGTM thanks @ggirotto 👍