AdMobSettings.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #if UNITY_IPHONE
  2. using UnityEngine;
  3. using UnityEditor;
  4. using UnityEditor.iOS.Xcode;
  5. using System.IO;
  6. namespace IronSource.Editor
  7. {
  8. public class AdMobSettings : IAdapterSettings
  9. {
  10. public void updateProject (BuildTarget buildTarget, string projectPath)
  11. {
  12. Debug.Log ("IronSource - Update project for AdMob");
  13. PBXProject project = new PBXProject ();
  14. project.ReadFromString (File.ReadAllText (projectPath));
  15. string targetId = project.TargetGuidByName (PBXProject.GetUnityTargetName ());
  16. // Required System Frameworks
  17. project.AddFrameworkToProject (targetId, "AudioToolbox.framework", false);
  18. project.AddFrameworkToProject (targetId, "EventKit.framework", false);
  19. project.AddFrameworkToProject (targetId, "EventKitUI.framework", false);
  20. project.AddFrameworkToProject (targetId, "MediaPlayer.framework", false);
  21. project.AddFrameworkToProject (targetId, "MessageUI.framework", false);
  22. project.AddFileToBuild (targetId, project.AddFile ("usr/lib/libz.1.2.5.tbd", "Frameworks/libz.1.2.5.tbd", PBXSourceTree.Sdk));
  23. // Custom Link Flag
  24. project.AddBuildProperty (targetId, "OTHER_LDFLAGS", "-ObjC");
  25. File.WriteAllText (projectPath, project.WriteToString ());
  26. }
  27. public void updateProjectPlist (BuildTarget buildTarget, string plistPath)
  28. {
  29. Debug.Log ("IronSource - Update plist for AdMob");
  30. }
  31. }
  32. }
  33. #endif