How to get BundleID from ApplicationToken?

I'm working witn FamilyActivitySelection


How to get bundleIdentifier from ApplicationToken? which I receive from FamilyActivitySelection?

I want to read AppIcon, AppName from bundleIdentifier

Also tried to read bundleIdentifier from Application?, but the value always returns as nil.

Answered by Frameworks Engineer in 746162022

In order to protect the user's privacy, activities returned to your app by the FamilyActivityPicker will never contain personally revealing information, such as the bundle identifier of apps or domains of visited websites. Your app is only provided with bundle identifiers and app names within Shield Configuration extensions and Device Activity Report extensions.

Accepted Answer

In order to protect the user's privacy, activities returned to your app by the FamilyActivityPicker will never contain personally revealing information, such as the bundle identifier of apps or domains of visited websites. Your app is only provided with bundle identifiers and app names within Shield Configuration extensions and Device Activity Report extensions.

I finally found a solution to your Problem. Instead of reading the AppIcon and AppName through the BundleID, you can retrieve it in a View using

Label(selection.applicationTokens.first!).labelStyle(.titleAndIcon)

You just need to get the applicationTokens and can retrieve the AppIcon and AppName through this Label. Hope this helps!

How to get BundleID from ApplicationToken?
 
 
Q