// 添加 URLTypes public static bool AddURLTypes(PlistDocument doc, string role, string URLName, string schemes) { PlistElementArray urlTypes = null; try { urlTypes = (PlistElementArray)doc.root.values["CFBundleURLTypes"]; } catch (Exception e) { } if (urlTypes == null) { urlTypes = doc.root.CreateArray("CFBundleURLTypes"); } var urlDict = urlTypes.AddDict(); urlDict.SetString("CFBundleTypeRole", role); urlDict.SetString("CFBundleURLName", URLName); urlDict.CreateArray("CFBundleURLSchemes").AddString(schemes); return(true); }
//private static void AddEmbedFrameworks(PBXProject proj, string targetGuid, string framework) //{ // //string fileGuid = proj.AddFile("usr/lib/" + lib, "Frameworks/" + lib, PBXSourceTree.Sdk); // //proj.AddFileToBuild(targetGuid, fileGuid); // string framework = Path.Combine(frameworkPath, fwk); // string fileGuid = proj.AddFile(framework, "Frameworks/" + framework, PBXSourceTree.Sdk); // PBXProjectExtensions.AddFileToEmbedFrameworks(proj, target, fileGuid); // proj.SetBuildProperty(target, "LD_RUNPATH_SEARCH_PATHS", "$(inherited) @executable_path/Frameworks"); //} // 添加 LSApplicationQueriesSchemes public static bool AddApplicationQueriesSchemes(PlistDocument doc, string[] schemes) { PlistElementArray queriesSchemes = null; try { queriesSchemes = (PlistElementArray)doc.root.values["LSApplicationQueriesSchemes"]; } catch (Exception e) { } if (queriesSchemes == null) { queriesSchemes = doc.root.CreateArray("LSApplicationQueriesSchemes"); } foreach (string scheme in schemes) { queriesSchemes.AddString(scheme); } return(true); }