-
Notifications
You must be signed in to change notification settings - Fork 62
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
multtiple widget showing #79
Comments
I am encountering the same issue in my Flutter code. I keep track of all activities I start and verify if I need to create new ones whenever the app is brought to the foreground using the Maybe @istornz has another idea. Feel free to take a look at my platform code. @available(iOS 16.1, *)
func createOrUpdateActivity(data: [String: Any], customId: String, removeWhenAppIsKilled: Bool, staleIn: Int?, result: @escaping FlutterResult) {
Task {
var customUUID = UUID(uuidString: customId)
var activityId: String? = Activity<LiveActivitiesAppAttributes>.activities.first {
$0.attributes.id == customUUID && $0.activityState != .dismissed && $0.activityState != .ended
}?.id
if activityId != nil {
updateActivity(activityId: activityId!, data: data, alertConfig: nil, result: result)
} else {
createActivity(data: data, removeWhenAppIsKilled: removeWhenAppIsKilled, staleIn: staleIn, customId: customId, result: result)
}
}
} |
@istornz do you happen to have any idea on what can be the reason for that issue and how to prevent it from happening? |
I'm interested in the topic as well since I'm getting multiple showing widgets too, even if the helper class uses this basic logic: if (activityID != null) {
await _liveActivitiesPlugin.updateActivity(activityID!, activityModel.toMap());
} else {
debugPrint('Activity ID is null, cannot start specified activity so we are starting a new activity');
activityID = await _liveActivitiesPlugin.createActivity(
activityModel.toMap(),
removeWhenAppIsKilled: true,
);
} And I'm expecting the widget to be updated and not created multiple times since the I really appreciate any help you can provide 🫶 |
there is anyone faced the same issue , am getting not every time , getting multtple widget showing
am using for charging progress
The text was updated successfully, but these errors were encountered: