NSMutableArray *installed = [NSMutableArray array];
NSDictionary *infoPlist = [[NSBundle mainBundle] infoDictionary];
NSArray *whitelistSchemes = infoPlist[@"LSApplicationQueriesSchemes"];
for(NSString *scheme in whitelistSchemes) {
NSURL *url = [NSURL URLWithString: [scheme stringByAppendingString: @"://"]];
if([[UIApplication sharedApplication] canOpenURL: url]) {
[installed addObject: scheme];
}
}
NSLog(@"Installed apps: %@", installed);
//Testing for limit (Not limited on iOS 9, can't link against previous versions)
for(NSInteger i = 0 ; i < 100 ; i ++) {
[[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString: [NSString stringWithFormat: @"%li://", (long)i]]];
}
Last active
March 5, 2016 15:55
-
-
Save natanavra/f34ce08885cdc2644c8c to your computer and use it in GitHub Desktop.
Testing LSApplicationQueriesSchemes
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment