Unity打包iOS后处理开启iCloud

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时遇到

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 2017年6月19日学习NLP自我践行第652天,学习教练之道践行第84天 砥砺前行。一夜半寐半醒。还是想着明天去...
    爱的路上Kailasapati阅读 173评论 0 0
  • 昨晚按要求讲完《花花和朵朵》,言言又不想睡,开始各种“协商”,最终达成一致,今天再编一个“小石头”的故事。 1. ...
    醒来么么阅读 606评论 1 2
  • 永之氓咸善游。一日,水暴甚,有五六氓,乘小船绝湘水。中济,船破,皆游。其一氓尽力而不能寻常。其侣曰:“汝善游最也,...
    芮家伟阅读 1,095评论 0 0