I have an app in private which need to scan all applications and schemes and get it by using private API LSApplicationWorkspace defaultWorkspace
with others functional method, such as privateURLSchemes
allInstalledApplications
. This app works good and I can get all I need from the private API before iOS 11, but in this version I only got some warning and an empty array. It seems Apple limits private API that developer can't use in private in iOS 11.
So my question is what alternative ways can achieve my need in iOS 11?
UPDATE: This method does not work on iOS 12 - entitlement required
There is a way to find if a specific application is installed, its not a list of all apps like allInstalledApplications
returned but its useful to query for a specific bundle id
Here is an example, the method receives bundle id and return true if it's installed on the device:
- (BOOL)checkIfAppInstalled: (NSString*)bundleID {
dlopen("/System/Library/PrivateFrameworks/MobileContainerManager.framework/MobileContainerManager",RTLD_NOW);
Class MBAppManager = NSClassFromString(@"MCMAppDataContainer");
NSError * error ;
id contentApp = [MBAppManager performSelector:@selector(containerWithIdentifier:error:) withObject:bundleID withObject:error];
return contentApp != nil;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With