private static void UpdateJsonWithBundleIdChooserDialog(string bundleId, bool ignoreModificationDate) { GenerateXmlFromGoogleServicesJson.ConfigFileType configFileType; if ((int)EditorUserBuildSettings.selectedBuildTargetGroup == 7) { configFileType = GenerateXmlFromGoogleServicesJson.ConfigFileType.Json; } else { if ((int)EditorUserBuildSettings.selectedBuildTargetGroup != 4) { return; } configFileType = GenerateXmlFromGoogleServicesJson.ConfigFileType.Plist; } GenerateXmlFromGoogleServicesJson.ConfigFileType arg_62_0 = configFileType; GenerateXmlFromGoogleServicesJson.FindGoogleServicesFileMode arg_62_2 = GenerateXmlFromGoogleServicesJson.FindGoogleServicesFileMode.ReturnBundleIdMatches; if (GenerateXmlFromGoogleServicesJson.f__mgcacheE == null) { GenerateXmlFromGoogleServicesJson.f__mgcacheE = new GenerateXmlFromGoogleServicesJson.LogMessage(GenerateXmlFromGoogleServicesJson.LogNoMessage); } GenerateXmlFromGoogleServicesJson.LogMessage arg_62_3 = GenerateXmlFromGoogleServicesJson.f__mgcacheE; if (GenerateXmlFromGoogleServicesJson.f__mgcacheF == null) { GenerateXmlFromGoogleServicesJson.f__mgcacheF = new GenerateXmlFromGoogleServicesJson.LogMessage(GenerateXmlFromGoogleServicesJson.LogNoMessage); } if (GenerateXmlFromGoogleServicesJson.FindGoogleServicesFile(arg_62_0, bundleId, arg_62_2, arg_62_3, GenerateXmlFromGoogleServicesJson.f__mgcacheF) != null || UnityCompat.InBatchMode) { GenerateXmlFromGoogleServicesJson.UpdateJson(UnityCompat.InBatchMode, null, null); return; } List <string> list = GenerateXmlFromGoogleServicesJson.BundleIdsFromBundleIdsByConfigFile(GenerateXmlFromGoogleServicesJson.ConfigFileDirectory); if (GenerateXmlFromGoogleServicesJson.spamguard || list.Count == 0) { return; } ChooserDialog.Show("请修复您的Bundle ID 大哥!!", "从Firebase配置中选择一个有效的Bundle ID", string.Format("您的捆绑包ID {0}不存在于您的FialBasic配置中。不匹配的捆绑ID会导致应用程序无法初始化。", bundleId), list.ToArray(), 0, "Apply", "Cancel", delegate(string selectedBundleId) { if (!string.IsNullOrEmpty(selectedBundleId)) { UnityCompat.ApplicationId = selectedBundleId; } else { GenerateXmlFromGoogleServicesJson.spamguard = true; } GenerateXmlFromGoogleServicesJson.UpdateJson(true, null, null); }); //ChooserDialog.Show("Please fix your Bundle ID", "Select a valid Bundle ID from your Firebase configuration.", string.Format("Your bundle ID {0} is not present in your Firebase configuration. A mismatched bundle ID will result in your application to fail to initialize.\n\nNew Bundle ID:", bundleId), list.ToArray(), 0, "Apply", "Cancel", delegate (string selectedBundleId) { // if (!string.IsNullOrEmpty(selectedBundleId)) { // UnityCompat.ApplicationId = selectedBundleId; // } else { // GenerateXmlFromGoogleServicesJson.spamguard = true; // } // GenerateXmlFromGoogleServicesJson.UpdateJson(true, null, null); //}); }
private static string CheckBundleId(string bundleId, bool promptUpdate = true, bool logErrorOnMissingBundleId = true) { if (XcodeProjectPatcher.configFile == null) { return(null); } Dictionary <string, string> config = XcodeProjectPatcher.GetConfig(); string text; if (!config.TryGetValue("BUNDLE_ID", out text)) { return(null); } if (!text.Equals(bundleId) && logErrorOnMissingBundleId && XcodeProjectPatcher.allBundleIds.Count > 0) { string[] array = XcodeProjectPatcher.allBundleIds.ToArray <string>(); string errorMessage = DocStrings.DocRef.GoogleServicesFileBundleIdMissing.Format(new object[] { bundleId, "GoogleServices-Info.plist", string.Join(", ", array), DocStrings.Link.IOSAddApp }); if (promptUpdate && !XcodeProjectPatcher.spamguard) { ChooserDialog.Show("Please fix your Bundle ID", "Select a valid Bundle ID from your Firebase configuration.", string.Format("Your bundle ID {0} is not present in your Firebase configuration. A mismatched bundle ID will result in your application to fail to initialize.\n\nNew Bundle ID:", bundleId), array, 0, "Apply", "Cancel", delegate(string selectedBundleId) { if (!string.IsNullOrEmpty(selectedBundleId)) { UnityCompat.ApplicationId = selectedBundleId; } else { XcodeProjectPatcher.spamguard = true; Debug.LogError(errorMessage); } XcodeProjectPatcher.ReadConfig(true, null); }); } else { Debug.LogError(errorMessage); } } return(text); }