11
11
using UnityEditor . iOS . Xcode ;
12
12
using System . Text ;
13
13
14
- #if UNITY_2017_1_OR_NEWER
14
+ #if UNITY_2017_2_OR_NEWER
15
15
using UnityEditor . iOS . Xcode . Extensions ;
16
16
#endif
17
17
@@ -35,7 +35,7 @@ public static void OnPostProcessBuild(BuildTarget target, string path)
35
35
// UserNotifications.framework is required by libOneSignal.a
36
36
project . AddFrameworkToProject ( targetGUID , "UserNotifications.framework" , false ) ;
37
37
38
- #if UNITY_2017_1_OR_NEWER && ! UNITY_CLOUD_BUILD
38
+ #if UNITY_2017_2_OR_NEWER && ! UNITY_CLOUD_BUILD
39
39
40
40
var extensionTargetName = "OneSignalNotificationServiceExtension" ;
41
41
var pathToNotificationService = path + "/" + extensionTargetName ;
@@ -123,7 +123,7 @@ public static void OnPostProcessBuild(BuildTarget target, string path)
123
123
File . WriteAllText ( projectPath , project . WriteToString ( ) ) ;
124
124
}
125
125
126
- #if UNITY_2017_1_OR_NEWER && ! UNITY_CLOUD_BUILD
126
+ #if UNITY_2017_2_OR_NEWER && ! UNITY_CLOUD_BUILD
127
127
128
128
// This function takes a static framework that is already linked to a different target in the project and links it to the specified target
129
129
public static void InsertStaticFrameworkIntoTargetBuildPhaseFrameworks ( string staticFrameworkName , string frameworkGuid , string target , ref string contents , PBXProject project ) {
@@ -152,7 +152,7 @@ public static void InsertStaticFrameworkIntoTargetBuildPhaseFrameworks(string st
152
152
//add the framework as an additional object in PBXBuildFile objects
153
153
contents = contents . Replace ( "; fileRef = " + fileRef + " /* " + staticFrameworkName + ".a */; };" , "; fileRef = " + fileRef + " /* " + staticFrameworkName + ".a */; };\n \t \t " + frameworkGuid + " /* " + staticFrameworkName + ".a in Frameworks */ = {isa = PBXBuildFile; fileRef = " + fileRef + " /* " + staticFrameworkName + ".a */; };" ) ;
154
154
155
- //fild the build phase ID number
155
+ //find the build phase ID number
156
156
string targetBuildPhaseId = project . GetFrameworksBuildPhaseByTarget ( target ) ;
157
157
string [ ] components = contents . Split ( new string [ ] { targetBuildPhaseId + " /* Frameworks */ = {\n \t \t \t isa = PBXFrameworksBuildPhase;\n \t \t \t buildActionMask = " } , StringSplitOptions . None ) ;
158
158
0 commit comments