public static bool UpdateTargetSdk() {
var minVersionAndPodNames = TargetSdkNeedsUpdate();
if (minVersionAndPodNames.Value != null) {
var minVersionString =
TargetSdkVersionToString(minVersionAndPodNames.Key);
var update = EditorUtility.DisplayDialog(
"Unsupported Target SDK",
"Target SDK selected in the iOS Player Settings (" +
TargetSdk + ") is not supported by the Cocoapods " +
"included in this project. " +
"The build will very likely fail. The minimum supported " +
"version is \"" + minVersionString + "\" " +
"required by pods (" +
String.Join(", ", minVersionAndPodNames.Value.ToArray()) +
").\n" +
"Would you like to update the target SDK version?",
"Yes", cancel: "No");
if (update) {
TargetSdkVersion = minVersionAndPodNames.Key;
string errorString = (
"Target SDK has been updated from " + TargetSdk +
" to " + minVersionString + ". You must restart the " +
"build for this change to take effect.");
EditorUtility.DisplayDialog(
"Target SDK updated.", errorString, "OK");
return true;
}
}
return false;
}