Преглед изворни кода

ios 打包 和 商品配置

gdl_123 пре 4 месеци
родитељ
комит
9e97179919

+ 9 - 9
Assets/Content/Config/IOSShopProductIDCfg.csv

@@ -1,11 +1,11 @@
 id,价格,商品ID,商品名字,其他
 id,amount,productID,productName,other
-1,0.99,ro.0.99.pro,0.99 Pack,
-2,1.99,ro.1.99.pro,1.99 Pack,
-3,2.99,ro.2.99.pro,2.99 Pack,
-4,4.99,ro.4.99.pro,4.99 Pack,
-5,9.99,ro.9.99.pro,9.99 Pack,
-6,14.99,ro.14.99.pro,14.99 Pack,
-7,19.99,ro.19.99.pro,19.99 Pack,
-8,49.99,ro.49.99.pro,49.99 Pack,
-9,99.99,ro.99.99.pro,99.99 Pack,
+1,0.99,intention0.99,0.99禮包,
+2,1.99,intention1.99,1.99禮包,
+3,2.99,intention2.99,2.99禮包,
+4,4.99,intention4.99,4.99禮包,
+5,9.99,intention9.99,9.99禮包,
+6,14.99,intention14.99,14.99禮包,
+7,19.99,intention19.99,19.99禮包,
+8,49.99,intention49.99,49.99禮包,
+9,99.99,intention99.99,99.99禮包,

+ 46 - 47
Assets/Editor/Pack/Platform/PackPlatformiOSBuild.cs

@@ -218,68 +218,67 @@ namespace Pack
             string unityFmwkGUid = pbxProject.GetUnityFrameworkTargetGuid();
             Debug.Log($"=================== targetGuid = {targetGuid} ===============");
 
-            
+            //pbxProject.AddCopyFilesBuildPhase(targetGuid, "SSBundle.bundle", Application.dataPath + "/Plugins/iOS", "");
 
-            pbxProject.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO");//enable Bitcode 设置 为 no
+            pbxProject.SetBuildProperty(targetGuid, "DEBUG_INFORMATION_FORMAT", "dwarf-with-dsym");
+            pbxProject.SetBuildProperty(targetGuid, "GCC_GENERATE_DEBUGGING_SYMBOLS", "YES");
+            pbxProject.SetBuildProperty(targetGuid, "COPY_PHASE_STRIP", "NO");
+            pbxProject.SetBuildProperty(targetGuid, "GCC_ENABLE_OBJC_EXCEPTIONS", "YES");
+            pbxProject.SetBuildProperty(targetGuid, "GCC_ENABLE_CPP_EXCEPTIONS", "YES");
 
-            pbxProject.AddBuildProperty(targetGuid, "OTHER_LDFLAGS", "-ObjC");
+            pbxProject.SetBuildProperty(targetGuid, "ENABLE_BITCODE", "NO");
+            pbxProject.AddBuildProperty(targetGuid, "OTHER_LDFLAGS", "-ObjC -lz");
             pbxProject.AddBuildProperty(unityFmwkGUid, "OTHER_LDFLAGS", "-ObjC");
-            // 设置 Allow Non-modular Includes in Framework Modules 为 true
-           // pbxProject.SetBuildProperty(targetGuid, "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES", "YES");
-            //pbxProject.SetBuildProperty(unityFmwkGUid, "CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES", "YES");
 
+            pbxProject.SetBuildProperty(targetGuid, "SWIFT_VERSION", "5.0");
+            //pbxProject.AddBuildProperty(targetGuid, "Library Search Path", "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)");
+            //pbxProject.AddBuildProperty(targetGuid, "Library Search Path", "$(SDKROOT)/usr/lib/swift");
 
-            
-            pbxProject.AddCapability(targetGuid,PBXCapabilityType.InAppPurchase);//内购
-            pbxProject.AddCapability(targetGuid,PBXCapabilityType.SignInWithApple);//苹果登录
+            pbxProject.AddBuildProperty(unityFmwkGUid, "LIBRARY_SEARCH_PATHS", "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)");
+            //pbxProject.AddBuildProperty(targetGuid, "LIBRARY_SEARCH_PATHS", "$(SDKROOT)/usr/lib/swift");
 
+            pbxProject.AddBuildProperty(unityFmwkGUid, "LIBRARY_SEARCH_PATHS", "$(SDKROOT)/usr/lib/swift");
+            pbxProject.AddBuildProperty(targetGuid, "Runpath Search Path", "/usr/lib/swift");
+            //pbxProject.AddBuildProperty(targetGuid, "RUNPATH_SEARCH_PATHS", "/usr/lib/swift");
+            //AdSupport.framework AuthenticationServices.framework, Accelerate.framework
 
-            
+            pbxProject.AddCapability(targetGuid, PBXCapabilityType.InAppPurchase);//内购
+            pbxProject.AddCapability(targetGuid, PBXCapabilityType.SignInWithApple);//苹果登录
 
-            //AddFrameworkToProject(pbxProject, unityFmwkGUid, new string[] { "Accelerate.framework" },false);
+            AddFrameworkToProject(pbxProject, targetGuid, new string[] { "libz.dylib", "libc++.dylib", "AdSupport.framework", "AuthenticationServices.framework", "Accelerate.framework" }, false);
+            AddFrameworkToProject(pbxProject, unityFmwkGUid, new string[] { "Accelerate.framework" }, false);
            
-            //pbxProject.AddAssetTagToDefaultInstall
             pbxProject.WriteToFile(pbxprojPath);
             EditorUtility.DisplayProgressBar("修改XCodeProject", "修改project.pbxproj完成", 0.25f);
 
             string plistPath = Path.Combine(outPath, "Info.plist");
             PlistDocument plistDocument = new PlistDocument();
             plistDocument.ReadFromFile(plistPath);
-
-
-            PlistCreateArray(plistDocument, "LSApplicationQueriesSchemes", new string[] { "fbauth2", "fbapi", "fb-messenger-share-api", "fbshareextension", "fb-messenger-api"});
-
-            //PlistCreateArray(plistDocument, "Queried URL Schemes", new string[] { "vk", "vk-share", "vkauthorize" });
-            PlistCreateDict(plistDocument, "NSAppTransportSecurity", new Dictionary<string, DictItem>() { { "NSAllowsArbitraryLoads", new DictItem("bool",true)} });
-
-            //Facebook AppID IOS: 1734387583815032
-            PlistCreateDict(plistDocument,"",new Dictionary<string, DictItem>() 
-            {
-                { "xuanyou_GameId",                 new DictItem("string", "127") },
-                { "FacebookAppID",                  new DictItem("string", "849135470863608") },
-                { "FacebookDisplayName",            new DictItem("string", "FacebookDisplayName") },
-                { "NSUserTrackingUsageDescription", new DictItem("string", "App would like to access IDFA for tracking purpose") },
-                { "NSPhotoLibraryAddUsageDescription", new DictItem("string", "Photo Library Add Usage Description") },
-                { "NSPhotoLibraryUsageDescription", new DictItem("string", "Photo Library Usage Description") },
-            },true);
-
-            PlistElementDict dict = PlistCreateDict(plistDocument, "SPAdjustConfig", new Dictionary<string, DictItem>() 
-            {
-                { "appToken", new DictItem("string","zg6ixp19pdz4")},
-            });
-
-            PlistCreateDict(plistDocument, "eventTokens", new Dictionary<string, DictItem>()
-            {
-                { "activeEventToken",       new DictItem("string","kky0yu")},
-                { "createRoleToken",        new DictItem("string","1p4znl")},
-                { "firstPayEventToken",     new DictItem("string","p6p840")},
-                { "noviceGuideEventToken",  new DictItem("string","21l1no")},
-                { "payEventToken",          new DictItem("string","ot7zkz")},
-                { "registerEventToken",     new DictItem("string","6s22py")},
-            },false, dict);
-
-
-            PlistAddUrlType(plistDocument, null, "facebook", "Editor", "fb849135470863608");
+   
+
+
+            //plistDocument.root.SetString("FacebookUrlSchemeSuffix", "3db62ef3789f3752a4a6d1b7ffc6f922");
+            /* FacebookAppID:facebook 后台应用参数
+             * FacebookUrlSchemeSuffix 应用参数后缀,后缀仅可使用字母字符。(可不设置,当多应用共用一个 appid 时需添加,可避免 FB 登录成功后返回到其他应用)
+             * FacebookDisplayNam:facebook 后台配置的应用名称{游戏名称}; 
+             * FacebookClientToken:在 facebook 后台应用设置->高级->客户端口令查看;
+             * LSApplicationQueriesSchemes:Facebook 相关白名单。*/
+
+            plistDocument.root.SetString("FacebookAppID", "743858834901692");
+
+            plistDocument.root.SetString("FacebookDisplayNam", "萌新冒險家");
+            plistDocument.root.SetString("FacebookClientToken", "0b39acbe80e234d4b9691451af1a4412");
+            PlistElementArray plArr = plistDocument.root.CreateArray("LSApplicationQueriesSchemes");
+            //fbapi
+            //fb-messenger-api
+            //fbauth2
+            //fbshareextension
+            //fb-messenger-share-api
+            plArr.AddString("fbapi");
+            plArr.AddString("fb-messenger-api");
+            plArr.AddString("fbauth2");
+            plArr.AddString("fbshareextension");
+            plArr.AddString("fb-messenger-share-api");
 
 
             plistDocument.WriteToFile(plistPath);