天天看点

获取iOS设备的安装的app的目录、、

  1. #include <objc/runtime.h>
  2. Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
  3. NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
  4. NSLog(@"apps: %@", [workspace performSelector:@selector(allApplications)]);

//检测设备是否安装了某个app

NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"];

BOOL hasInstagram = [[UIApplication sharedApplication] canOpenURL:instagramURL]; 

继续阅读