Skip to content

Commit

Permalink
Fix iOS update AppTransportSecurity
Browse files Browse the repository at this point in the history
  • Loading branch information
Str4tos committed Jan 14, 2022
1 parent a990b33 commit 6f7ff02
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 25 deletions.
4 changes: 2 additions & 2 deletions Editor/CASInitSettignsInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ private void OnUserTrackingGUI()
userTrackingUsageDescriptionProp.ClearArray();
}
}
HelpStyles.HelpButton( Utils.gitUnityRepoURL + "/wiki/Asking-Permissions" );
HelpStyles.HelpButton( Utils.gitUnityRepoURL + "/wiki/App-Tracking-Transparency" );
EditorGUILayout.EndHorizontal();
if (enabled)
userTrackingList.DoLayoutList();
Expand Down Expand Up @@ -582,7 +582,7 @@ private void OnEDMAreaGUI()
EditorGUILayout.BeginHorizontal();
EditorGUILayout.HelpBox( "Changing dependencies will change the project settings. " +
"Please use Android Resolver after the change complete.", MessageType.Info );
if (GUILayout.Button( "Resolve", GUILayout.ExpandWidth( false ), GUILayout.ExpandHeight( true ) ))
if (GUILayout.Button( "Resolve", GUILayout.ExpandWidth( false ), GUILayout.Height( 38 ) ))
{
#if UNITY_ANDROID
var succses = Utils.TryResolveAndroidDependencies();
Expand Down
43 changes: 20 additions & 23 deletions Editor/CASPostprocessBuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ namespace CAS.UEditor
{
internal class CASPostprocessBuild
{
[PostProcessBuild()]
public static void OnPostProcessBuild( BuildTarget buildTarget, string buildPath )
[PostProcessBuild( 47 )]//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)
public static void FixPodFileBug( BuildTarget target, string buildPath )
{
if (buildTarget != BuildTarget.iOS)
if (target != BuildTarget.iOS)
return;

// Init Settings can be null
Expand Down Expand Up @@ -59,33 +59,30 @@ public static void OnPostProcessBuild( BuildTarget buildTarget, string buildPath

ApplyCrosspromoDynamicLinks( buildPath, mainTargetGuid, initSettings, depManager );

Debug.Log( CASEditorUtils.logTag + "Postrocess Build done." );
}

#if UNITY_2019_3_OR_NEWER || CASDeveloper
[PostProcessBuild( 47 )]//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)
public static void FixPodFileBug( BuildTarget target, string buildPath )
{
if (target != BuildTarget.iOS)
return;
var podPath = buildPath + "/Podfile";
if (!File.Exists( podPath ))
if (File.Exists( podPath ))
{
Debug.LogError( CASEditorUtils.logTag + "Podfile not found.\n" +
"Please add `target 'Unity-iPhone' do end` to the Podfile in root folder of XCode project and call `pod install --no-repo-update`" );
return;
var content = File.ReadAllText( podPath );
if (!content.Contains( "'Unity-iPhone'" ))
{
using (StreamWriter sw = File.AppendText( podPath ))
{
sw.WriteLine();
sw.WriteLine( "target 'Unity-iPhone' do" );
sw.WriteLine( "end" );
}
}
}
var content = File.ReadAllText( podPath );
if (content.Contains( "'Unity-iPhone'" ))
return;
using (StreamWriter sw = File.AppendText( podPath ))
else
{
sw.WriteLine();
sw.WriteLine( "target 'Unity-iPhone' do" );
sw.WriteLine( "end" );
Debug.LogError( CASEditorUtils.logTag + "Podfile not found.\n" +
"Please add `target 'Unity-iPhone' do end` to the Podfile in root folder " +
"of XCode project and call `pod install --no-repo-update`" );
}
}
#endif
Debug.Log( CASEditorUtils.logTag + "Postrocess Build done." );
}

[PostProcessBuild( int.MaxValue )]
public static void OnCocoaPodsReady( BuildTarget buildTarget, string buildPath )
Expand Down
2 changes: 2 additions & 0 deletions Runtime/Common/IMediationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ public interface IMediationManager: ISingleBannerManager

/// <summary>
/// Set enabled <see cref="AdType"/> to processing.
/// <para>If processing is inactive then all calls to the selected ad type
/// will fail with error <see cref="AdError.ManagerIsDisabled"/>.</para>
/// <para>The state will not be saved between sessions.</para>
/// </summary>
void SetEnableAd( AdType adType, bool enabled );
Expand Down

0 comments on commit 6f7ff02

Please sign in to comment.