Skip to content

Commit 22e6ec7

Browse files
author
Adam Schlesinger
committed
Switch to EDM4Us recommendation instead of calling pod install ourselves
1 parent 1d62f24 commit 22e6ec7

File tree

1 file changed

+6
-22
lines changed

1 file changed

+6
-22
lines changed

com.onesignal.unity.ios/Editor/BuildPostProcessor.cs

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ [Flags] private enum Entitlement {
9191

9292
private readonly PBXProject _project = new PBXProject();
9393

94-
public int callbackOrder => int.MaxValue;
94+
/// <summary>
95+
/// must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and that it's
96+
/// added before "pod install" (50)
97+
/// https://github.com/googlesamples/unity-jar-resolver#appending-text-to-generated-podfile
98+
/// </summary>
99+
public int callbackOrder => 45;
95100

96101
/// <summary>
97102
/// Entry for the build post processing necessary to get the OneSignal SDK iOS up and running
@@ -279,27 +284,6 @@ private void ExtensionAddPodsToTarget() {
279284

280285
podfile += $"target '{ServiceExtensionTargetName}' do\n pod 'OneSignalXCFramework', '~> 3.8.1'\nend\n";
281286
File.WriteAllText(podfilePath, podfile);
282-
283-
var installResult = _runShellCommand($"-c \"pod install --project-directory={_outputPath}\"");
284-
if (!installResult.Contains("Installing OneSignalXCFramework"))
285-
Debug.LogError($"Could not detect install with Cocoapods. {ServiceExtensionFilename} may have errors.");
286-
}
287-
288-
private static string _runShellCommand(string command) {
289-
var process = new Process {
290-
StartInfo = new ProcessStartInfo {
291-
FileName = "/bin/sh",
292-
Arguments = command,
293-
RedirectStandardOutput = true,
294-
UseShellExecute = false,
295-
CreateNoWindow = true,
296-
}
297-
};
298-
299-
process.Start();
300-
var ret = process.StandardOutput.ReadToEnd();
301-
process.WaitForExit();
302-
return ret;
303287
}
304288
}
305289
}

0 commit comments

Comments
 (0)