From e323fa388da3206a9d9762ecfc52c9e54f3ef1e7 Mon Sep 17 00:00:00 2001 From: Andrii Kurdiumov Date: Tue, 11 Oct 2022 12:49:44 +0600 Subject: [PATCH] Fix compilation errors Also optimize for copy-paste workflow. --- README.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b49cf1e2..80c80bd8 100644 --- a/README.md +++ b/README.md @@ -453,19 +453,24 @@ The resolution strategy can be changed via the In order to modify the generated Podfile you can create a script like this: ``` using System.IO; -public class PostProcessIOS : MonoBehaviour { -[PostProcessBuildAttribute(45)]//must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and that it's added before "pod install" (50) -private static void PostProcessBuild_iOS(BuildTarget target, string buildPath) +using UnityEditor; +using UnityEditor.Callbacks; +using UnityEngine; + +public class PostProcessIOS : MonoBehaviour { + [PostProcessBuildAttribute(45)]//must be between 40 and 50 to ensure that it's not overriden by Podfile generation (40) and that it's added before "pod install" (50) + private static void PostProcessBuild_iOS(BuildTarget target, string buildPath) + { if (target == BuildTarget.iOS) { - using (StreamWriter sw = File.AppendText(buildPath + "/Podfile")) { //in this example I'm adding an app extension sw.WriteLine("\ntarget 'NSExtension' do\n pod 'Firebase/Messaging', '6.6.0'\nend"); } } + } } ```