获取项目配置的所有Schemes

NSArray *urls = [[NSBundle mainBundle] infoDictionary][@"CFBundleURLTypes"];
    NSMutableString *appScheme = [NSMutableString string];
    NSMutableArray *allSchemes = [NSMutableArray array];
    BOOL multiUrls = [urls count] > 1;
    for (NSDictionary *url in urls) {
        NSArray *schemes = url[@"CFBundleURLSchemes"];
        if (!multiUrls ||
            (multiUrls && [@"alipay" isEqualToString:url[@"CFBundleURLName"]])) {
            [appScheme appendString:schemes[0]];
            break;
        }
        [allSchemes addObjectsFromArray:schemes];
    }
    NSLog(@"%@",allSchemes);

你可能感兴趣的:(获取项目配置的所有Schemes)