Hi all!
Is it possible to retrieve detailed data of applications from opaque token which we receive from FamilyActivityPicker?
If no, is it possible retrieve application info especially icon from applications that were selected in FamilyActivityPicker?
Thank you!
Yes, the documentation is incorrect here. The Label should be given an actual ApplicationToken, not a binding to it (the "$" character at the start of the parameter). The following would fix the compilation error:
Label(selection.applicationTokens.first!) // <-- compiles, but not useful
but that code isn't really usable, since it would crash if the selection doesn't have any application tokens. An alternative is something like this:
if let applicationToken = model.selectionToDiscourage.applicationTokens.first {
Label(applicationToken)
}
else {
Label("No application", systemImage: "app.dashed")
}