Hello! I've been doing a lot of work with ApplicationTokens, but there is very little documentation. While Apple gives you the FamilyAcitvitiesPicker to get tokens of apps on an iPhone, I need to get the tokens of apps that aren't on the phone.
Example:
Someone can select Instagram even though they don't have it downloaded. Then the application token will get sent to a server. Then a different person who does have Instagram on their phone will receive the token and it will do something with that application.
Because FamilyActivitiesPicker can only select apps on the iPhone that it is running on, FamilyActivitiesPicker is useless to me, leading to my problem:
Creating an ApplicationToken without FamilyActivitiesPicker
This documentation says that I can create an Application (and thus an ApplicationToken) from the bundle identifier
init(bundleIdentifier: String)
Creates an object that represents the app with the specified bundle
identifier.
However, when I try to use this to get instagrams(or any apps) token, it returns nil every time!
So, finally, my questions:
How do I correctly use this initializer to create an ApplicationToken?
Or, if this won't work for my purposes
Are the ApplicationTokens created by FamilyActivitiesPicker the same across all devices no matter what?
Hey, To my knowledge, you cannot create Tokens from bundle ID, only get them from the FamilyActivitiyPicker.
I can also confirm that tokens are not portable across devices, an Instagram token on device A is not the same as on device B, using it to block apps will just do nothing on device B.
I'm almost certain you cannot achieve what you are trying to do with the current set of APIs provided by Apple.
I believe this is behaving as designed by apple for privacy reasons.
Good luck !