判断是否有安装了app

513 阅读1分钟
 - (void)IsInstalledApp{
    
    Class Panduan = objc_getClass("LSApplicationWorkspace");
    BOOL isInstalled = [[Panduan new] performSelector:@selector(applicationIsInstalled:) withObject:@"bundle ID(如:com.wechat.com)"];
    if (isInstalled == YES) {
        NSLog(@"有");
    }
    else
    {
        NSLog(@"没有");
    }


还有就是用canOpenURL判断, 不过有了白名单之后就不知道行不行了