app根据URL跳转到AppStore相对应的软件

来源:互联网 发布:kvm和vmware区别 知乎 编辑:程序博客网 时间:2024/05/13 22:57
1.

  Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");

    NSObject* workspace = [LSApplicationWorkspace_classperformSelector:@selector(defaultWorkspace)];

    NSArray *allApplications = [workspaceperformSelector:@selector(allApplications)];//这样就能获取到手机中安装的所有App

    NSLog(@"%@",allApplications);


2. //http://www.apple.com/cn/itunes/charts/       AppStore上的软件url


3.

 NSString *urlString = [NSStringstringWithFormat:@"WeChat://"];//最好去shareSDK中查找

        if([[UIApplicationsharedApplication]openURL:[NSURLURLWithString:urlString]])

        {

            //软件直接打开

        }

        else

        {

//没有软件就去apstore里下载

            NSString*appstroe=[NSStringstringWithFormat:@"https://itunes.apple.com/cn/app/wei-xin/id414478124?mt=8&v0=WWW-GCCN-ITSTOP100-FREEAPPS&l=&ign-mpt=uo%3D4"];

            [[UIApplicationsharedApplication]openURL:[NSURLURLWithString:appstroe]];

        }


0 0
原创粉丝点击