-
Notifications
You must be signed in to change notification settings - Fork 56
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
Dynamic Island interaction & ui not showing #57
Comments
Hi Okunamutata, I had the same problem, and took me about a day to figure it out, and i have some tips for you:
hope this helps |
Hey @xTriple thanks, i double check the configs and yea its working now. However im unable to read data from Here some of the code, Im able to see my values as let sharedDefault = UserDefaults(suiteName: "group.<my_bundle_identifier>.sf")!
@available(iOSApplicationExtension 16.1, *)
struct WidgetLiveActivity: Widget {
var body: some WidgetConfiguration {
ActivityConfiguration(for: LiveActivitiesAppAttributes.self) { context in
// Lock screen/banner UI goes here
let heading = sharedDefault.string(forKey: "name") ?? "Workout in progress"
let isRest = sharedDefault.bool(forKey: "rest") final Map<String, dynamic> activityModel = <String, dynamic>{
'name': exerciseModel.mvmt.title,
'rest': exerciseModel.sets[index].isRest
};
try {
if (id == null) {
id = await _liveActivitiesPlugin.createActivity(
activityModel, removeWhenAppIsKilled: true);
log(id.toString());
} else {
await _liveActivitiesPlugin.updateActivity(id!, activityModel);
}
} catch (e) {
log(e.toString());
} Any tips would be great 🌮 |
Hey @Okunamutata, the only way for you to test your Dynamic island with a debugger is only by Xcode. If you think your problem is inside Xcode you can try to create an app iOS native and try from there. Try to take the example project swift file let me know how it goes 🧐 |
Hey @xTriple thanks. it seems to be an issue with The the dart code init's the plugin this warning is shown in Xcode Couldn't read values in CFPrefsPlistSource<0x2829e0990> (Domain: group.< my_bundle_identifier >.sf, User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd |
Hi @Okunamutata & @xTriple configs : Update : |
Hi @Okunamutata you can follow this thread for the solution (https://developer.apple.com/forums/thread/51348?page=2) @kartikeyaa-k for you i can say this:
|
@xTriple I found the issue for my project and it is working now.
instead of
and make sure you add the same extension at the bottom from sample file. Verify the name is correct for your project. Thanks @xTriple |
I added the following code to the swift file to extend the LiveActivitiesAppAttributes and got the value
|
Thanks. I appreciate the helper function. It works now. |
I have the same issue how you solve it please @Okunamutata |
I've implemented the plugin following the readme. I tried a few times on my project and the counter flutter template project.
After calling
_liveActivitiesPlugin.init
theres no error. But the return value of that function results to anull
.Im able to call
createActivity
and receive a String id value.But nothing is happening visually.
I do see a widget can be added to the homescreen, but thats it.
Heres all the dart code. Any help would be really appreciated
The text was updated successfully, but these errors were encountered: