美文网首页
Unity打包iOS后处理开启iCloud

Unity打包iOS后处理开启iCloud

作者: Jens丶 | 来源:发表于2020-03-02 15:19 被阅读0次
Unity摊
                string relativeEntitlementFilePath = "Unity-iPhone/amsw.entitlements";
                string absoluteEntitlementFilePath = buildPath + "/" + relativeEntitlementFilePath;
                PlistDocument tempEntitlements = new PlistDocument();
            

                //iCloud Container
                string icloudContainerId= "iCloud.com.apple.bundleid";
                PlistElementArray icloudIDsArr = new PlistElementArray();
                icloudIDsArr.AddString(icloudContainerId);

                PlistElementArray icloudSersArr = new PlistElementArray();
                icloudSersArr.AddString("CloudDocuments");
                    
                tempEntitlements.root["com.apple.developer.icloud-container-identifiers"] = icloudIDsArr;
                tempEntitlements.root["com.apple.developer.icloud-services"] = icloudSersArr;
                tempEntitlements.root["com.apple.developer.ubiquity-container-identifiers"] = icloudIDsArr;
                pbxProject.AddCapability(targetGUID, PBXCapabilityType.iCloud,relativeEntitlementFilePath);
                
                tempEntitlements.WriteToFile(absoluteEntitlementFilePath);

一定要注意!!!!!!!!!!!!

xcode必须登录苹果开发者账号 && 苹果开发者后台需开启iCloud并生成新的描述文件

以上是在接入5.3.1版本的helpshift时遇到

相关文章

网友评论

      本文标题:Unity打包iOS后处理开启iCloud

      本文链接:https://www.haomeiwen.com/subject/rbqvkhtx.html