Compare commits
No commits in common. "master" and "v1.1.8_android" have entirely different histories.
master
...
v1.1.8_and
@ -1,195 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BFEditor.Build
|
||||
{
|
||||
public class CompareAssetBundleWindow : EditorWindow
|
||||
{
|
||||
private string newestABPath = "";
|
||||
private string lastABPath = "";
|
||||
public bool IsAndroid = true;
|
||||
private List<string> ABList = new List<string>();
|
||||
Vector2 resultScrollPos;
|
||||
public CompareAssetBundleWindow()
|
||||
{
|
||||
titleContent = new GUIContent("AssetBundle对比");
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
GetNewestABPath();
|
||||
}
|
||||
|
||||
void OnGUI()
|
||||
{
|
||||
GUILayout.Space(18);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("当前版本AB路径");
|
||||
GUILayout.TextField(newestABPath, GUILayout.Width(600));
|
||||
if (GUILayout.Button("选择", GUILayout.Width(80)))
|
||||
{
|
||||
string openPath = EditorUtility.OpenFolderPanel("select ab path", newestABPath, "");
|
||||
if (openPath.CompareTo("") != 0){
|
||||
newestABPath = openPath;
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(10);
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("上个版本AB路径");
|
||||
GUILayout.TextField(lastABPath, GUILayout.Width(600));
|
||||
if (GUILayout.Button("选择", GUILayout.Width(80)))
|
||||
{
|
||||
string openPath = EditorUtility.OpenFolderPanel("select ab path", lastABPath, "");
|
||||
if (openPath.CompareTo("") != 0){
|
||||
lastABPath = openPath;
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(10);
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Space(150);
|
||||
if (GUILayout.Button("对比", GUILayout.Width(200), GUILayout.Height(40)))
|
||||
{
|
||||
CheckMD5AndAssetHash();
|
||||
}
|
||||
|
||||
GUILayout.Space(100);
|
||||
if (GUILayout.Button("使用上个版本的AB修复", GUILayout.Width(200), GUILayout.Height(40)))
|
||||
{
|
||||
UseLastABFix();
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(30);
|
||||
|
||||
DrawResult();
|
||||
}
|
||||
|
||||
private void DrawResult()
|
||||
{
|
||||
resultScrollPos = GUILayout.BeginScrollView(resultScrollPos, GUILayout.Width(800), GUILayout.Height(620));
|
||||
for (int i = ABList.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var path = ABList[i];
|
||||
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Space(20);
|
||||
EditorGUILayout.TextField(path);
|
||||
|
||||
GUILayout.Space(10);
|
||||
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
GUILayout.EndScrollView();
|
||||
}
|
||||
|
||||
private void CheckMD5AndAssetHash()
|
||||
{
|
||||
if (string.IsNullOrEmpty(newestABPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(lastABPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
ABList.Clear();
|
||||
var manifestPath = System.IO.Path.Combine(newestABPath, "asset_bundle_manifest.ab");
|
||||
var manifestAB = AssetBundle.LoadFromFile(manifestPath);
|
||||
var Manifest = manifestAB.LoadAsset<AssetBundleManifest>("AssetBundleManifest");
|
||||
manifestAB.Unload(false);
|
||||
|
||||
var lastManifestPath = System.IO.Path.Combine(lastABPath, "asset_bundle_manifest.ab");
|
||||
var lastManifestAB = AssetBundle.LoadFromFile(lastManifestPath);
|
||||
var lastManifest = lastManifestAB.LoadAsset<AssetBundleManifest>("AssetBundleManifest");
|
||||
lastManifestAB.Unload(false);
|
||||
|
||||
var allAB = Manifest.GetAllAssetBundles();
|
||||
foreach(var path in allAB)
|
||||
{
|
||||
if (path.Contains("ab_config.bytes") || path.Contains("asset_bundle_manifest.ab"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var fullPathA = Path.Combine(newestABPath, path);
|
||||
var fullPathB = Path.Combine(lastABPath, path);
|
||||
if (File.Exists(fullPathB) && BF.GameLaunchUtils.GetFileMD5(fullPathA).CompareTo(BF.GameLaunchUtils.GetFileMD5(fullPathB)) != 0)
|
||||
{
|
||||
if (Manifest.GetAssetBundleHash(path) == lastManifest.GetAssetBundleHash(path))
|
||||
{
|
||||
// md5 不一致但是AssetHash一致的情况
|
||||
ABList.Add(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void UseLastABFix()
|
||||
{
|
||||
if (string.IsNullOrEmpty(newestABPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (string.IsNullOrEmpty(lastABPath))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (ABList.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach(var path in ABList)
|
||||
{
|
||||
var fullPathA = Path.Combine(newestABPath, path);
|
||||
var fullPathB = Path.Combine(lastABPath, path);
|
||||
File.Copy(fullPathB, fullPathA, true);
|
||||
}
|
||||
var version = newestABPath.Substring(newestABPath.Replace("\\", "/").LastIndexOf("/") + 1);
|
||||
AssetBundleUtils.RegenerateABConfigMd5(newestABPath, version);
|
||||
|
||||
ABList.Clear();
|
||||
}
|
||||
|
||||
public static void ShowWindow()
|
||||
{
|
||||
var window = GetWindow<CompareAssetBundleWindow>();
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private void GetNewestABPath()
|
||||
{
|
||||
var bundleCachePath = IsAndroid ? Application.dataPath + "/../HistoryAssetBundles" : Application.dataPath + "/../HistoryAssetBundles/IOS";
|
||||
var dirInfo = new DirectoryInfo(bundleCachePath);
|
||||
var dirs = dirInfo.GetDirectories();
|
||||
if (dirs.Length == 0)
|
||||
{
|
||||
newestABPath = "";
|
||||
lastABPath = "";
|
||||
}
|
||||
if (dirs.Length == 1)
|
||||
{
|
||||
newestABPath = dirs[0].FullName;
|
||||
lastABPath = "";
|
||||
}
|
||||
var hightestIndex = 0;
|
||||
var secondIndex = 0;
|
||||
for (var i = 1; i < dirs.Length; i++)
|
||||
{
|
||||
if (dirs[i].FullName.CompareTo(dirs[hightestIndex].FullName) > 0)
|
||||
{
|
||||
secondIndex = hightestIndex;
|
||||
hightestIndex = i;
|
||||
}
|
||||
}
|
||||
newestABPath = dirs[hightestIndex].FullName;
|
||||
if (hightestIndex > 0)
|
||||
{
|
||||
lastABPath = dirs[secondIndex].FullName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ea05efeb3467b0947b735c8fe281cb8c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -192,34 +192,10 @@ namespace BFEditor.Build
|
||||
}
|
||||
}
|
||||
|
||||
[MenuItem("打包工具/AssetBundles/对比上一个版本AB Android", priority = 207)]
|
||||
static void CompareLastVersionABAndroid()
|
||||
{
|
||||
var window = (CompareAssetBundleWindow)EditorWindow.GetWindowWithRect(typeof(CompareAssetBundleWindow),
|
||||
new Rect(Screen.width / 2, Screen.height / 2, 800, 800), true);
|
||||
window.IsAndroid = true;
|
||||
window.Show();
|
||||
}
|
||||
|
||||
[MenuItem("打包工具/AssetBundles/对比上一个版本AB IOS", priority = 208)]
|
||||
static void CompareLastVersionABIOS()
|
||||
{
|
||||
var window = (CompareAssetBundleWindow)EditorWindow.GetWindowWithRect(typeof(CompareAssetBundleWindow),
|
||||
new Rect(Screen.width / 2, Screen.height / 2, 800, 800), true);
|
||||
window.IsAndroid = false;
|
||||
window.Show();
|
||||
}
|
||||
|
||||
[MenuItem("打包工具/打包窗口", priority = 301)]
|
||||
static void ShowBuildWindow()
|
||||
{
|
||||
BuildProjectWindow.ShowWindow();
|
||||
}
|
||||
|
||||
[MenuItem("打包工具/Android转换为AAB工程", priority = 401)]
|
||||
static void ConvertAndroidStudioToAAB()
|
||||
{
|
||||
BuildAndroidUtils.ConvertToAAB();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,8 +13,6 @@ namespace BFEditor.Build
|
||||
|
||||
public class BuildProjectWindow : EditorWindow
|
||||
{
|
||||
private static int versionCode = 18;
|
||||
private static string versionName = "1.6.5";
|
||||
BFPlatformOptions platform = BFPlatformOptions.AndroidDev;
|
||||
const string ANDROID_DEV_PACKAGE_NAME = "com.juzu.b6.dev.android";
|
||||
const string ANDROID_RELEASE_PACKAGE_NAME = "com.juzu.b6.release.android";
|
||||
@ -36,7 +34,7 @@ namespace BFEditor.Build
|
||||
platform = (BFPlatformOptions)EditorGUILayout.EnumPopup("", platform);
|
||||
EditorGUILayout.Space();
|
||||
|
||||
EditorGUILayout.LabelField("版本: " + versionName);
|
||||
EditorGUILayout.LabelField("版本: 0.1.0");
|
||||
EditorGUILayout.Space();
|
||||
|
||||
string packageName;
|
||||
@ -72,8 +70,7 @@ namespace BFEditor.Build
|
||||
if (GUILayout.Button("一键打包"))
|
||||
{
|
||||
var buildInfo = new BuildInfo();
|
||||
buildInfo.version = versionName;
|
||||
buildInfo.version_code = versionCode;
|
||||
buildInfo.version = "0.1.0";
|
||||
buildInfo.mode = mode;
|
||||
buildInfo.bundleName = packageName;
|
||||
buildInfo.skipVersion = skipVersion;
|
||||
|
||||
@ -3,7 +3,6 @@ using UnityEditor;
|
||||
using System.IO;
|
||||
using UnityEditor.Build.Reporting;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Threading;
|
||||
|
||||
@ -30,14 +29,8 @@ namespace BFEditor.Build
|
||||
static string GoogleCommonProjectPath = Application.dataPath + "/../BFVersions/android/google_common";
|
||||
static string GPAsProjectPath = Application.dataPath + "/../BFVersions/android/ub-gp"; // gp删档测试渠道
|
||||
static string GPOfficialAsProjectPath = Application.dataPath + "/../BFVersions/android/ub-google"; // gp正式渠道
|
||||
static string PublishAsProjectPath = Application.dataPath + "/../BFVersions/android/publish_release";
|
||||
static string SignShellPath = Application.dataPath + "/../BFFiles/androidkey";
|
||||
static string GpAlginShellPath = Application.dataPath + "/../BFFiles/androidkey";
|
||||
static HashSet<string> AABInPackageFileHashSet = new HashSet<string>()
|
||||
{
|
||||
"bin",
|
||||
"UnityServicesProjectConfiguration.json"
|
||||
};
|
||||
|
||||
static BuildAndroidUtils()
|
||||
{
|
||||
@ -289,7 +282,6 @@ namespace BFEditor.Build
|
||||
else if(buildInfo.IsGPChannel())
|
||||
{
|
||||
MergeProject(buildInfo, GoogleAsProjectPath);
|
||||
FixGradleVersion(buildInfo.version_code, buildInfo.version);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@ -399,19 +391,13 @@ namespace BFEditor.Build
|
||||
static void FixGradleVersion(int versionCode, string versionName)
|
||||
{
|
||||
Debug.Log("[bfinfo]修正build.gradle: VersionCode " + versionCode + " VersionName " + versionName);
|
||||
var gradleFilePath = Path.Combine(PublishAsProjectPath, "launcher", "build.gradle");
|
||||
var gradleFilePath = Path.Combine(GradleExcuteProjectPath, "build.gradle");
|
||||
var text = File.ReadAllText(gradleFilePath);
|
||||
var regex = new Regex("versionCode 1");
|
||||
text = regex.Replace(text, string.Format("versionCode {0}", versionCode));
|
||||
var regex2 = new Regex("versionName '0.1.0'");
|
||||
text = regex2.Replace(text, string.Format("versionName '{0}'", versionName));
|
||||
regex = new Regex("versionName '0.1'");
|
||||
text = regex.Replace(text, string.Format("versionName '{0}'", versionName));
|
||||
File.WriteAllText(gradleFilePath, text);
|
||||
|
||||
var gradleFilePath2 = Path.Combine(PublishAsProjectPath, "unityLibrary", "build.gradle");
|
||||
var text2 = File.ReadAllText(gradleFilePath2);
|
||||
text2 = regex.Replace(text2, string.Format("versionCode {0}", versionCode));
|
||||
text2 = regex2.Replace(text2, string.Format("versionName '{0}'", versionName));
|
||||
File.WriteAllText(gradleFilePath2, text2);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -557,77 +543,5 @@ namespace BFEditor.Build
|
||||
tmp.Abort();
|
||||
}
|
||||
}
|
||||
|
||||
public static void ConvertToAAB()
|
||||
{
|
||||
var installTimePackDirPath = Path.Combine(PublishAsProjectPath, "../", "dz_google_abb", "install_time_pack");
|
||||
var targetDirPath = Path.Combine(PublishAsProjectPath, "install_time_pack");
|
||||
if (Directory.Exists(targetDirPath))
|
||||
{
|
||||
Directory.Delete(targetDirPath, true);
|
||||
Directory.CreateDirectory(targetDirPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
Directory.CreateDirectory(targetDirPath);
|
||||
}
|
||||
|
||||
BFEditorUtils.CopyDir(installTimePackDirPath, targetDirPath);
|
||||
|
||||
var abDirPath = Path.Combine(PublishAsProjectPath, "unityLibrary/src/main/assets");
|
||||
var destFolderName = Path.Combine(PublishAsProjectPath, "install_time_pack/src/main/assets");
|
||||
var dirInfo = new DirectoryInfo(abDirPath);
|
||||
var floders = dirInfo.GetDirectories();
|
||||
for (var i = 0; i < floders.Length; i++)
|
||||
{
|
||||
if (AABInPackageFileHashSet.Contains(floders[i].Name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var newDir = Path.Combine(destFolderName, floders[i].Name);
|
||||
if (!Directory.Exists(newDir))
|
||||
{
|
||||
Directory.CreateDirectory(newDir);
|
||||
}
|
||||
BFEditorUtils.CopyDir(floders[i].FullName, newDir);
|
||||
Directory.Delete(floders[i].FullName, true);
|
||||
}
|
||||
|
||||
var files = dirInfo.GetFiles();
|
||||
for (var i = 0; i < files.Length; i++)
|
||||
{
|
||||
var file = files[i];
|
||||
if (AABInPackageFileHashSet.Contains(file.Name))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
var destFile = Path.Combine(destFolderName, file.Name);
|
||||
if (File.Exists(destFile))
|
||||
{
|
||||
File.Delete(destFile);
|
||||
}
|
||||
File.Move(file.FullName, destFile);
|
||||
}
|
||||
|
||||
var settingsGradleFilePath = Path.Combine(PublishAsProjectPath, "settings.gradle");
|
||||
var text = File.ReadAllText(settingsGradleFilePath);
|
||||
var appendText = "include ':install_time_pack'";
|
||||
if (!text.EndsWith(appendText))
|
||||
{
|
||||
text = text + "\n" + appendText;
|
||||
}
|
||||
File.WriteAllText(settingsGradleFilePath, text);
|
||||
|
||||
var buildGradlePath = Path.Combine(PublishAsProjectPath, "launcher/build.gradle");
|
||||
var buildGradleText = File.ReadAllText(buildGradlePath);
|
||||
var regex2 = new Regex("assetPacks = [\":install_time_pack\"]");
|
||||
if (!regex2.IsMatch(buildGradleText))
|
||||
{
|
||||
var regex22 = new Regex("android {");
|
||||
buildGradleText = regex22.Replace(buildGradleText, "android {\n assetPacks = [\":install_time_pack\"]");
|
||||
}
|
||||
File.WriteAllText(buildGradlePath, buildGradleText);
|
||||
Debug.Log("Android转换为AAB工程完成");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,76 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
using UnityEditor.Build.Reporting;
|
||||
using UnityEngine;
|
||||
|
||||
#if UNITY_IOS
|
||||
using UnityEditor.iOS.Xcode;
|
||||
#endif
|
||||
|
||||
public class IOSLocalizationTool
|
||||
{
|
||||
public static readonly Dictionary<SystemLanguage, string> validLanguageMap = new Dictionary<SystemLanguage, string>()
|
||||
{
|
||||
[SystemLanguage.English] = "en",
|
||||
[SystemLanguage.ChineseSimplified] = "zh-Hans",
|
||||
[SystemLanguage.ChineseTraditional] = "zh-Hant",
|
||||
[SystemLanguage.Japanese] = "ja",
|
||||
[SystemLanguage.Korean] = "ko",
|
||||
[SystemLanguage.Spanish] = "es",
|
||||
[SystemLanguage.Vietnamese] = "vi",
|
||||
[SystemLanguage.Thai] = "th",
|
||||
[SystemLanguage.Indonesian] = "id",
|
||||
[SystemLanguage.Portuguese] = "pt",
|
||||
};
|
||||
|
||||
public static void SetLocalization(string pathToBuiltProject)
|
||||
{
|
||||
#if UNITY_IOS
|
||||
string buildPath = pathToBuiltProject;
|
||||
const string infoPlistName = "Info.plist";
|
||||
|
||||
var plistPath = Path.Combine(buildPath, infoPlistName);
|
||||
PlistDocument plist = new PlistDocument();
|
||||
plist.ReadFromFile(plistPath);
|
||||
|
||||
// url schemes
|
||||
const string bundleLocalizationKey = "CFBundleLocalizations";
|
||||
|
||||
if (!plist.root.values.TryGetValue(bundleLocalizationKey, out var localizations))
|
||||
{
|
||||
localizations = plist.root.CreateArray(bundleLocalizationKey);
|
||||
}
|
||||
|
||||
foreach (string value in validLanguageMap.Values)
|
||||
{
|
||||
localizations.AsArray().AddString(value);
|
||||
}
|
||||
|
||||
plist.WriteToFile(plistPath);
|
||||
|
||||
var projectPath = PBXProject.GetPBXProjectPath(buildPath);
|
||||
var project = new PBXProject();
|
||||
project.ReadFromFile(projectPath);
|
||||
var target = project.GetUnityMainTargetGuid();
|
||||
var resourceTarget = project.GetResourcesBuildPhaseByTarget(target);
|
||||
|
||||
foreach (string value in validLanguageMap.Values)
|
||||
{
|
||||
var path = Path.Combine(Path.Combine(Application.dataPath, "../", "BFVersions/ios/ios_common"), $"{value}.lproj");
|
||||
var inProjectPath = Path.GetFileName(path);
|
||||
project.AddFolderReference(path, inProjectPath);
|
||||
var resGUID = project.FindFileGuidByProjectPath(inProjectPath);
|
||||
project.AddFileToBuildSection(
|
||||
target,
|
||||
resourceTarget,
|
||||
resGUID);
|
||||
}
|
||||
|
||||
project.WriteToFile(projectPath);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4be556fddd0e984428c0410a562496d8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -20,25 +20,18 @@ namespace BFEditor
|
||||
// }
|
||||
const string BOARD_EXCEL_KEY = "bf_board_excel_key";
|
||||
const string BOARD_GRID_TYPE_KEY = "bf_board_grid_type_key";
|
||||
const string BOARD_GRID_EDGE_KEY = "bf_board_grid_edge_key";
|
||||
int gridCount = 49;
|
||||
string battleImgDirectory = "Assets/arts/textures/ui/battle/";
|
||||
string boardFilepath;
|
||||
string boardGridTypePath;
|
||||
string boardGridEdgePath;
|
||||
string boardFiledName = "board";
|
||||
string boardEdgeFiledName = "grid_edge";
|
||||
string randomTypeStr = "";
|
||||
string boardEdgeStr = "";
|
||||
int curIndex = 1;
|
||||
int maxRow = 7;
|
||||
Dictionary<int, Dictionary<string, string>> boardGridTypeDict = new Dictionary<int, Dictionary<string, string>>();
|
||||
Dictionary<int, JArray> boardDict = new Dictionary<int, JArray>();
|
||||
Dictionary<int, JArray> outPutBoardDict = new Dictionary<int, JArray>();
|
||||
Dictionary<string, Texture> imgDict = new Dictionary<string, Texture>();
|
||||
Dictionary<int, Dictionary<string, string>> boardGridEdgeDict = new Dictionary<int, Dictionary<string, string>>();
|
||||
Dictionary<int, JArray> edgeDict = new Dictionary<int, JArray>();
|
||||
Dictionary<int, JArray> outPutBoardEdgeDict = new Dictionary<int, JArray>();
|
||||
bool loadExcelOver = false;
|
||||
Dictionary<int, string> elementTypeImgDict = new Dictionary<int, string>(){
|
||||
[1] = "red_1",
|
||||
@ -62,12 +55,6 @@ namespace BFEditor
|
||||
{
|
||||
boardGridTypePath = "选择grid_type配置表路径";
|
||||
}
|
||||
|
||||
boardGridEdgePath = GetBoardGridEdgePath();
|
||||
if (boardGridEdgePath.Equals(""))
|
||||
{
|
||||
boardGridEdgePath = "选择grid_edge_type配置表路径";
|
||||
}
|
||||
string[] paths = Directory.GetFiles(battleImgDirectory);
|
||||
foreach(var path in paths)
|
||||
{
|
||||
@ -99,16 +86,6 @@ namespace BFEditor
|
||||
PlayerPrefs.SetString(BOARD_GRID_TYPE_KEY, path);
|
||||
}
|
||||
|
||||
string GetBoardGridEdgePath()
|
||||
{
|
||||
return PlayerPrefs.GetString(BOARD_GRID_EDGE_KEY, "");
|
||||
}
|
||||
|
||||
void SetBoardGridEdgePath(string path)
|
||||
{
|
||||
PlayerPrefs.SetString(BOARD_GRID_EDGE_KEY, path);
|
||||
}
|
||||
|
||||
BoardEditorWindow()
|
||||
{
|
||||
this.titleContent = new GUIContent("棋盘编辑器");
|
||||
@ -137,20 +114,6 @@ namespace BFEditor
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("grid_edge 路径", GUILayout.Width(100));
|
||||
GUILayout.Space(10);
|
||||
GUILayout.TextField(boardGridEdgePath, GUILayout.Width(300));
|
||||
if (GUILayout.Button("选择", GUILayout.Width(80)))
|
||||
{
|
||||
string openPath = EditorUtility.OpenFilePanel("选择配置表", GetBoardGridEdgePath(), "");
|
||||
if (openPath.CompareTo("") != 0)
|
||||
{
|
||||
boardGridEdgePath = openPath;
|
||||
SetBoardGridEdgePath(openPath);
|
||||
}
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
|
||||
GUILayout.Space(10);
|
||||
GUILayout.BeginHorizontal();
|
||||
@ -342,74 +305,6 @@ namespace BFEditor
|
||||
boardDict[curIndex] = ja;
|
||||
}
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.EndArea();
|
||||
GUILayout.BeginArea(new Rect(730, 650, 500, 500));
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.Label("棋盘边缘元素");
|
||||
boardEdgeStr = GUILayout.TextField(boardEdgeStr, GUILayout.Width(400), GUILayout.Height(100));
|
||||
if(GUILayout.Button("加载边缘元素配置", GUILayout.Width(110)))
|
||||
{
|
||||
JArray edgeJo = edgeDict[curIndex];
|
||||
string str = "[";
|
||||
for (int i = 0; i < edgeJo.Count; i++)
|
||||
{
|
||||
JArray gridInfo = (JArray)edgeJo[i];
|
||||
if (gridInfo.Count < 3)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
string s = "{";
|
||||
for (int j = 0; j < 3; j++)
|
||||
{
|
||||
s = s + gridInfo[j].ToString();
|
||||
if(j != 2)
|
||||
{
|
||||
s = s + ", ";
|
||||
}
|
||||
}
|
||||
s = s + "}";
|
||||
str = str + s;
|
||||
if (i != edgeJo.Count)
|
||||
{
|
||||
str = str + ", ";
|
||||
}
|
||||
}
|
||||
boardEdgeStr = str;
|
||||
}
|
||||
if(GUILayout.Button("重新刷新边缘元素", GUILayout.Width(110)))
|
||||
{
|
||||
string[] units = boardEdgeStr.Split('{');
|
||||
List<string> edgeList = new List<string>();
|
||||
for (int i = 0; i < units.Length; i++)
|
||||
{
|
||||
string formatStr = units[i].Replace("[", "").Replace("]", "").Replace(" ", "").Replace("}", "");
|
||||
string[] unitList = formatStr.Split(',');
|
||||
if (unitList.Length >= 3)
|
||||
{
|
||||
string str = "[";
|
||||
for(int j = 0; j < 3; j++)
|
||||
{
|
||||
str = str + unitList[j];
|
||||
if (j != 2)
|
||||
{
|
||||
str = str + ",";
|
||||
}
|
||||
}
|
||||
str = str + "]";
|
||||
edgeList.Add(str);
|
||||
}
|
||||
}
|
||||
|
||||
JArray ja = new JArray();
|
||||
for (int i = 0; i < edgeList.Count; i++)
|
||||
{
|
||||
JArray unit = (JArray)JsonConvert.DeserializeObject(edgeList[i]);
|
||||
ja.Add(unit);
|
||||
}
|
||||
edgeDict[curIndex] = ja;
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
GUILayout.EndArea();
|
||||
if(GUI.Button(new Rect(1050, 10, 100, 30), "导出到Excel"))
|
||||
{
|
||||
@ -462,21 +357,6 @@ namespace BFEditor
|
||||
boardGridTypeDict[key] = dict;
|
||||
}
|
||||
|
||||
// 读取grid_edge_type配置表
|
||||
BFEditorUtils.RunCommond("python", "load_board.py " + tempPath + " " + boardGridEdgePath, pythonToolPath);
|
||||
string boardGridEdgeJson = File.ReadAllText(tempPath);
|
||||
jsonObj = (JObject)JsonConvert.DeserializeObject(boardGridEdgeJson);
|
||||
foreach (var item in jsonObj)
|
||||
{
|
||||
int key = int.Parse(item.Key);
|
||||
Dictionary<string, string> dict = new Dictionary<string, string>();
|
||||
foreach (var item2 in (JObject)item.Value)
|
||||
{
|
||||
dict[item2.Key] = item2.Value.ToString();
|
||||
}
|
||||
boardGridEdgeDict[key] = dict;
|
||||
}
|
||||
|
||||
// 读取boardFile配置表
|
||||
BFEditorUtils.RunCommond("python", "load_board.py " + tempPath + " " + boardFilepath, pythonToolPath);
|
||||
string boardFileJson = File.ReadAllText(tempPath);
|
||||
@ -489,12 +369,6 @@ namespace BFEditor
|
||||
boardDict[key] = copyBoard((JArray)item.Value[boardFiledName]);
|
||||
outPutBoardDict[key] = copyBoard((JArray)item.Value[boardFiledName]);
|
||||
}
|
||||
if (item.Value[boardEdgeFiledName] != null)
|
||||
{
|
||||
int key = int.Parse(item.Key);
|
||||
edgeDict[key] = copyBoard((JArray)item.Value[boardEdgeFiledName]);
|
||||
outPutBoardEdgeDict[key] = copyBoard((JArray)item.Value[boardEdgeFiledName]);
|
||||
}
|
||||
}
|
||||
|
||||
loadExcelOver = true;
|
||||
@ -520,7 +394,7 @@ namespace BFEditor
|
||||
void DragBoard()
|
||||
{
|
||||
Texture img;
|
||||
GUI.DrawTexture(new Rect(0, 200, 702, 702), boardImg);
|
||||
GUI.DrawTexture(new Rect(0, 150, 702, 702), boardImg);
|
||||
if(!loadExcelOver)
|
||||
{
|
||||
return;
|
||||
@ -532,7 +406,7 @@ namespace BFEditor
|
||||
return;
|
||||
}
|
||||
|
||||
GUILayout.BeginArea(new Rect(0, 200, 702, 702));
|
||||
GUILayout.BeginArea(new Rect(0, 150, 702, 702));
|
||||
GUILayout.BeginVertical();
|
||||
JArray jo = boardDict[curIndex];
|
||||
int posIndex = 0;
|
||||
@ -578,52 +452,9 @@ namespace BFEditor
|
||||
GUILayout.EndHorizontal();
|
||||
}
|
||||
GUILayout.EndVertical();
|
||||
if (edgeDict.ContainsKey(curIndex))
|
||||
{
|
||||
JArray edgeJo = edgeDict[curIndex];
|
||||
for (int i = 0; i < edgeJo.Count; i++)
|
||||
{
|
||||
JArray gridInfo = (JArray)edgeJo[i];
|
||||
if(gridInfo.Count < 3)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
int posId = (int)gridInfo[0];
|
||||
int edgeType = (int)gridInfo[1];
|
||||
int dir = (int)gridInfo[2];
|
||||
// 绘制类型
|
||||
if(boardGridEdgeDict[edgeType].ContainsKey("icon"))
|
||||
{
|
||||
string icon = boardGridEdgeDict[edgeType]["icon"];
|
||||
if (imgDict.ContainsKey(icon))
|
||||
{
|
||||
int row = posId / 10;
|
||||
int col = posId % 10;
|
||||
img = imgDict[icon];
|
||||
if (dir == 1)
|
||||
{
|
||||
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth, startOffset + (row - 1) * textureWidth - 16, 92, 32), img);
|
||||
}
|
||||
else if (dir == 2)
|
||||
{
|
||||
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth, startOffset + (row - 1) * textureWidth - 16 + textureWidth, 92, 32), img);
|
||||
}
|
||||
else if (dir == 3)
|
||||
{
|
||||
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth - 16, startOffset + (row - 1) * textureWidth - 16, 32, 92), img);
|
||||
}
|
||||
else if (dir == 4)
|
||||
{
|
||||
GUI.DrawTexture(new Rect(startOffset + (col - 1) * textureWidth - 16 + textureWidth, startOffset + (row - 1) * textureWidth - 16, 32, 92), img);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GUILayout.EndArea();
|
||||
|
||||
GUILayout.BeginArea(new Rect(730, 200, 510 * 7, 550 / 7 * maxRow));
|
||||
GUILayout.BeginArea(new Rect(730, 150, 510 * 7, 550 / 7 * maxRow));
|
||||
GUILayout.BeginVertical();
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("棋盘配置信息", GUILayout.Width(100), GUILayout.Height(30));
|
||||
|
||||
@ -136,17 +136,71 @@ namespace BFEditor
|
||||
var configFileInfos = configDirInfo.GetFiles(suffix, SearchOption.TopDirectoryOnly);
|
||||
|
||||
// 检查棋盘文件格式
|
||||
checkBoard("chapter_board", env, sb);
|
||||
checkBoard("chapter_board_bossrush", env, sb);
|
||||
checkBoard("chapter_board_daily_challenge", env, sb);
|
||||
checkBoard("chapter_board_dungeon_armor", env, sb);
|
||||
checkBoard("chapter_board_dungeon_equip", env, sb);
|
||||
checkBoard("chapter_board_dungeon_gold", env, sb);
|
||||
checkBoard("chapter_board_dungeon_shards", env, sb);
|
||||
checkBoard("chapter_board_rune", env, sb);
|
||||
checkBoard("activity_pvp_board", env, sb);
|
||||
checkBoard("arena_board", env, sb);
|
||||
|
||||
var luaScriptString = @"local cfg = require('app/config/chapter_board')
|
||||
if not cfg or not cfg.data then
|
||||
return ''
|
||||
end
|
||||
cfg = cfg.data
|
||||
local tempMap = {}
|
||||
local addErrorInfo = function(errorInfo, cfgId, errorStr)
|
||||
if not tempMap[cfgId] then
|
||||
tempMap[cfgId] = true
|
||||
table.insert(errorInfo, 'cfgId = ' .. cfgId)
|
||||
end
|
||||
|
||||
table.insert(errorInfo, ' ' .. errorStr)
|
||||
end
|
||||
|
||||
local errorInfo = {}
|
||||
for k, info in pairs(cfg) do
|
||||
local board = info.board
|
||||
if not board then
|
||||
addErrorInfo(errorInfo, k, '没有board字段,请检查')
|
||||
end
|
||||
|
||||
if #board < 49 then
|
||||
addErrorInfo(errorInfo, k, '没有board长度不足,请检查,当前长度为' .. #board)
|
||||
end
|
||||
|
||||
for index, v in ipairs(board) do
|
||||
if not v[1] then
|
||||
addErrorInfo(errorInfo, k, 'board字段中' .. index .. '索引没有格子类型')
|
||||
end
|
||||
if not v[2] then
|
||||
addErrorInfo(errorInfo, k, 'board字段中' .. index .. '索引没有元素类型')
|
||||
end
|
||||
end
|
||||
|
||||
local mystery_box_board = info.mystery_box_board
|
||||
if mystery_box_board then
|
||||
for index, v in ipairs(mystery_box_board) do
|
||||
if not v[1] then
|
||||
addErrorInfo(errorInfo, k, 'mystery_box_board字段中' .. index .. '索引没有格子类型')
|
||||
end
|
||||
if not v[2] then
|
||||
addErrorInfo(errorInfo, k, 'mystery_box_board字段中' .. index .. '索引没有元素类型')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if #errorInfo > 0 then
|
||||
return table.concat(errorInfo, '\n');
|
||||
end
|
||||
|
||||
return ''";
|
||||
var resultStr = env.DoString(luaScriptString);
|
||||
if (resultStr.Length > 0)
|
||||
{
|
||||
foreach(var strObj in resultStr)
|
||||
{
|
||||
var str = Convert.ToString(strObj);
|
||||
if(!String.IsNullOrEmpty(str))
|
||||
{
|
||||
sb.Append(str + "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 检查monster
|
||||
string monsterConfigListLua = "{";
|
||||
@ -159,7 +213,7 @@ namespace BFEditor
|
||||
}
|
||||
}
|
||||
monsterConfigListLua += "}";
|
||||
var luaScriptString = "local ids = {}\n local MONSTER_LIST = " + monsterConfigListLua + "\n";
|
||||
luaScriptString = "local ids = {}\n local MONSTER_LIST = " + monsterConfigListLua + "\n";
|
||||
luaScriptString += @"local str = {}
|
||||
for i, name in ipairs(MONSTER_LIST) do
|
||||
if name ~= 'monster_base' and name ~= 'monster_position' and name ~= 'monster_position_base' then
|
||||
@ -176,7 +230,7 @@ namespace BFEditor
|
||||
return table.concat(str, '\n');
|
||||
end
|
||||
return ''";
|
||||
var resultStr = env.DoString(luaScriptString);
|
||||
resultStr = env.DoString(luaScriptString);
|
||||
if (resultStr.Length > 0)
|
||||
{
|
||||
foreach(var strObj in resultStr)
|
||||
@ -245,76 +299,6 @@ namespace BFEditor
|
||||
return sb;
|
||||
}
|
||||
|
||||
public static void checkBoard(string configName, LuaEnv env, in StringBuilder sb)
|
||||
{
|
||||
var luaScriptString = @"
|
||||
if not cfg or not cfg.data then
|
||||
return ''
|
||||
end
|
||||
cfg = cfg.data
|
||||
local tempMap = {}
|
||||
local addErrorInfo = function(errorInfo, cfgId, errorStr)
|
||||
if not tempMap[cfgId] then
|
||||
tempMap[cfgId] = true
|
||||
table.insert(errorInfo, 'cfgId = ' .. cfgId)
|
||||
end
|
||||
|
||||
table.insert(errorInfo, ' ' .. errorStr)
|
||||
end
|
||||
|
||||
local errorInfo = {}
|
||||
for k, info in pairs(cfg) do
|
||||
local board = info.board or info.board_daily_challenge
|
||||
if not board then
|
||||
addErrorInfo(errorInfo, k, configName .. ' 没有board字段,请检查')
|
||||
else
|
||||
if #board < 49 then
|
||||
addErrorInfo(errorInfo, k, configName .. ' 没有board长度不足,请检查,当前长度为' .. #board)
|
||||
end
|
||||
|
||||
for index, v in ipairs(board) do
|
||||
if not v[1] then
|
||||
addErrorInfo(errorInfo, k, configName .. ' board字段中' .. index .. '索引没有格子类型')
|
||||
end
|
||||
if not v[2] then
|
||||
addErrorInfo(errorInfo, k, configName .. ' board字段中' .. index .. '索引没有元素类型')
|
||||
elseif v[2] > 5 or v[2] < 0 then
|
||||
addErrorInfo(errorInfo, k, configName .. ' board字段中' .. index .. '元素类型不合法,当前为' .. v[2])
|
||||
end
|
||||
end
|
||||
|
||||
local mystery_box_board = info.mystery_box_board
|
||||
if mystery_box_board then
|
||||
for index, v in ipairs(mystery_box_board) do
|
||||
if not v[1] then
|
||||
addErrorInfo(errorInfo, k, configName .. ' mystery_box_board字段中' .. index .. '索引没有格子类型')
|
||||
end
|
||||
if not v[2] then
|
||||
addErrorInfo(errorInfo, k, configName .. ' mystery_box_board字段中' .. index .. '索引没有元素类型')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
if #errorInfo > 0 then
|
||||
return table.concat(errorInfo, '\n');
|
||||
end
|
||||
|
||||
return ''";
|
||||
var resultStr = env.DoString(" local cfg = require('app/config/" + configName + "')\n" + "local configName = '" + configName + "'\n" + luaScriptString);
|
||||
if (resultStr.Length > 0)
|
||||
{
|
||||
foreach(var strObj in resultStr)
|
||||
{
|
||||
var str = Convert.ToString(strObj);
|
||||
if(!String.IsNullOrEmpty(str))
|
||||
{
|
||||
sb.Append(str + "\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static bool FastExportExcelToLua(bool isDeveloper, string designExcelPath)
|
||||
{
|
||||
failFlag = false;
|
||||
|
||||
@ -104,7 +104,7 @@ namespace BFEditor
|
||||
[MenuItem("其他工具/棋盘编辑器", false, 9)]
|
||||
public static void CreateBoardEditorWindow()
|
||||
{
|
||||
var window = (BoardEditorWindow)EditorWindow.GetWindowWithRect(typeof(BoardEditorWindow), new Rect(Screen.width / 2, Screen.height / 2, 1200, 1000), true);
|
||||
var window = (BoardEditorWindow)EditorWindow.GetWindowWithRect(typeof(BoardEditorWindow), new Rect(Screen.width / 2, Screen.height / 2, 1200, 850), true);
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
|
||||
@ -11,8 +11,8 @@ public class JenkinsAdapter {
|
||||
/// 构建版本号
|
||||
/// </summary>
|
||||
private static string BuildVersion = (int.Parse(DateTime.Now.ToString("yyMMddHH"))).ToString();
|
||||
private static int versionCode = 10;
|
||||
private static string versionName = "1.4.0";
|
||||
private static int versionCode = 8;
|
||||
private static string versionName = "1.2.8";
|
||||
|
||||
[MenuItem("Jenkins/JenkinsBuildIos")]
|
||||
public static void CommandLineBuildIos() {
|
||||
@ -27,7 +27,7 @@ public class JenkinsAdapter {
|
||||
|
||||
// 设置版本号
|
||||
PlayerSettings.bundleVersion = buildInfo.version;
|
||||
//SDK要求
|
||||
//Jenkins要求自动构建最低ios8.0
|
||||
PlayerSettings.iOS.targetOSVersionString = "12.0";
|
||||
//设置Build,每次需要增加
|
||||
PlayerSettings.iOS.buildNumber = versionCode.ToString();
|
||||
|
||||
@ -68,8 +68,7 @@ namespace BFEditor
|
||||
"TMPro.SortingLayerHelper",
|
||||
"UnityEngine.CloudStreaming",
|
||||
"BFEditor.EditorBattleRoleAttackOperate",
|
||||
"IronSourceBannerEvents", "IronSourceEvents", "IronSourceInterstitialEvents", "IronSourceRewardedVideoEvents",
|
||||
"IronSourceAdQualityManifestTools"
|
||||
"IronSourceBannerEvents", "IronSourceEvents", "IronSourceInterstitialEvents", "IronSourceRewardedVideoEvents"
|
||||
};
|
||||
|
||||
static bool isExcluded(Type type)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
BIN
Assets/Plugins/Android/android-bridge.jar
Normal file
BIN
Assets/Plugins/Android/android-bridge.jar
Normal file
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f10a601320ff74e1e96ecfd77be278c5
|
||||
guid: cbe75846a2b4da1459371181319ce8e3
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@ -8,28 +8,19 @@
|
||||
url "https://maven.google.com"
|
||||
}
|
||||
maven {
|
||||
url "https://android-sdk.is.com/" // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:9, Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:48, Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:16
|
||||
url "https://android-sdk.is.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9, Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16, Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:16, Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8, Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:8, Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:16, Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:16, Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:16, Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:8, Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8, Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8
|
||||
}
|
||||
maven {
|
||||
url "https://maven.google.com/" // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:17, Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:25, Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:40, Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
||||
url "https://maven.google.com/" // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17, Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25, Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8, Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:8, Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:15, Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:15, Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:8, Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:8, Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
||||
}
|
||||
maven {
|
||||
url "https://cboost.jfrog.io/artifactory/chartboost-ads/" // Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:15
|
||||
url "https://repo.maven.apache.org/maven2/" // Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
||||
}
|
||||
maven {
|
||||
url "https://repo.maven.apache.org/maven2/" // Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
||||
url "https://artifact.bytedance.com/repository/pangle/" // Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
||||
}
|
||||
maven {
|
||||
url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/" // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:8, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:16, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:24, Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:32
|
||||
}
|
||||
maven {
|
||||
url "https://artifact.bytedance.com/repository/pangle/" // Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
||||
}
|
||||
maven {
|
||||
url "https://sdk.tapjoy.com/" // Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
||||
}
|
||||
maven {
|
||||
url "https://jitpack.io/" // Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:8
|
||||
url "https://sdk.tapjoy.com/" // Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
||||
}
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
@ -43,50 +34,42 @@ apply plugin: 'com.android.library'
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
// Android Resolver Dependencies Start
|
||||
implementation 'androidx.recyclerview:recyclerview:1.2.1' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:40
|
||||
implementation 'com.adcolony:sdk:4.8.0' // Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8
|
||||
implementation 'com.adcolony:sdk:4.8.0' // Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:8
|
||||
implementation 'com.android.installreferrer:installreferrer:2.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:10
|
||||
implementation 'com.android.support:appcompat-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||
implementation 'com.android.support:cardview-v7:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||
implementation 'com.android.support:customtabs:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||
implementation 'com.android.support:support-v4:25.3.1' // Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDependency
|
||||
implementation 'com.applovin:applovin-sdk:11.10.1' // Assets/ThirdParty/MaxSdk/AppLovin/Editor/Dependencies.xml:4
|
||||
implementation 'com.appsflyer:adrevenue:6.5.4' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerAdRevenueDependencies.xml:4
|
||||
implementation 'com.applovin:applovin-sdk:11.7.1' // Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:15
|
||||
implementation 'com.appsflyer:af-android-sdk:6.4.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:6
|
||||
implementation 'com.appsflyer:unity-adrevenue-generic-wrapper:6.5.4' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerAdRevenueDependencies.xml:5
|
||||
implementation 'com.appsflyer:unity-wrapper:6.4.1' // Assets/ThirdParty/AppsFlyer/Editor/AppsFlyerDependencies.xml:8
|
||||
implementation 'com.chartboost:chartboost-sdk:9.3.1' // Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:15
|
||||
implementation 'com.facebook.android:audience-network-sdk:6.16.0' // Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:8
|
||||
implementation 'com.chartboost:chartboost-sdk:9.2.0' // Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:15
|
||||
implementation 'com.facebook.android:audience-network-sdk:6.12.0' // Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:8
|
||||
implementation 'com.facebook.android:facebook-applinks:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:6
|
||||
implementation 'com.facebook.android:facebook-core:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:5
|
||||
implementation 'com.facebook.android:facebook-gamingservices:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:9
|
||||
implementation 'com.facebook.android:facebook-login:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:7
|
||||
implementation 'com.facebook.android:facebook-share:[15.1,16)' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:8
|
||||
implementation 'com.fyber:marketplace-sdk:8.2.4' // Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
||||
implementation 'com.google.android.gms:play-services-ads:22.2.0' // Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:8
|
||||
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:17
|
||||
implementation 'com.google.android.gms:play-services-basement:18.1.0' // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:25
|
||||
implementation 'com.ironsource.adapters:adcolonyadapter:4.3.15' // Assets/ThirdParty/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:admobadapter:4.3.39' // Assets/ThirdParty/IronSource/Editor/ISAdMobAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:applovinadapter:4.3.39' // Assets/ThirdParty/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:chartboostadapter:4.3.12' // Assets/ThirdParty/IronSource/Editor/ISChartboostAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:facebookadapter:4.3.45' // Assets/ThirdParty/IronSource/Editor/ISFacebookAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:fyberadapter:4.3.28' // Assets/ThirdParty/IronSource/Editor/ISFyberAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:mintegraladapter:4.3.19' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:48
|
||||
implementation 'com.ironsource.adapters:pangleadapter:4.3.22' // Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:tapjoyadapter:4.1.25' // Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:unityadsadapter:4.3.33' // Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:vungleadapter:4.3.22' // Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.sdk:mediationsdk:7.5.1' // Assets/ThirdParty/IronSource/Editor/IronSourceSDKDependencies.xml:9
|
||||
implementation 'com.mbridge.msdk.oversea:mbbanner:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:24
|
||||
implementation 'com.mbridge.msdk.oversea:mbbid:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:32
|
||||
implementation 'com.mbridge.msdk.oversea:newinterstitial:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:8
|
||||
implementation 'com.mbridge.msdk.oversea:reward:16.5.21' // Assets/ThirdParty/IronSource/Editor/ISMintegralAdapterDependencies.xml:16
|
||||
implementation 'com.pangle.global:ads-sdk:5.5.0.5' // Assets/ThirdParty/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
||||
implementation 'com.fyber:marketplace-sdk:8.2.2' // Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:8
|
||||
implementation 'com.google.android.gms:play-services-ads:21.5.0' // Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:8
|
||||
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:17
|
||||
implementation 'com.google.android.gms:play-services-basement:18.1.0' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:25
|
||||
implementation 'com.ironsource.adapters:adcolonyadapter:4.3.14' // Assets/IronSource/Editor/ISAdColonyAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:admobadapter:4.3.35' // Assets/IronSource/Editor/ISAdMobAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:applovinadapter:4.3.37' // Assets/IronSource/Editor/ISAppLovinAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:chartboostadapter:4.3.11' // Assets/IronSource/Editor/ISChartboostAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:facebookadapter:4.3.39' // Assets/IronSource/Editor/ISFacebookAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:fyberadapter:4.3.24' // Assets/IronSource/Editor/ISFyberAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:liftoffadapter:4.3.5' // Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:16
|
||||
implementation 'com.ironsource.adapters:pangleadapter:4.3.17' // Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:tapjoyadapter:4.1.24' // Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.adapters:unityadsadapter:4.3.27' // Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:8
|
||||
implementation 'com.ironsource.sdk:mediationsdk:7.3.0.1' // Assets/IronSource/Editor/IronSourceSDKDependencies.xml:9
|
||||
implementation 'com.pangle.global:ads-sdk:5.0.0.8' // Assets/IronSource/Editor/ISPangleAdapterDependencies.xml:15
|
||||
implementation 'com.parse.bolts:bolts-android:1.4.0' // Assets/ThirdParty/FacebookSDK/Plugins/Editor/Dependencies.xml:4
|
||||
implementation 'com.tapjoy:tapjoy-android-sdk:13.0.1' // Assets/ThirdParty/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
||||
implementation 'com.unity3d.ads:unity-ads:4.9.1' // Assets/ThirdParty/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
||||
implementation 'com.vungle:vungle-ads:7.0.0' // Assets/ThirdParty/IronSource/Editor/ISVungleAdapterDependencies.xml:8
|
||||
implementation 'com.tapjoy:tapjoy-android-sdk:12.11.1' // Assets/IronSource/Editor/ISTapJoyAdapterDependencies.xml:15
|
||||
implementation 'com.unity3d.ads:unity-ads:4.6.1' // Assets/IronSource/Editor/ISUnityAdsAdapterDependencies.xml:15
|
||||
implementation 'io.liftoff:liftoffads:1.9.1' // Assets/IronSource/Editor/ISLiftoffAdapterDependencies.xml:8
|
||||
// Android Resolver Dependencies End
|
||||
**DEPS**}
|
||||
|
||||
|
||||
@ -111,8 +111,8 @@ public partial class AdManager
|
||||
string networkPlacement = adInfo.NetworkPlacement; // The placement ID from the network that showed the ad
|
||||
string adFormat = adInfo.AdFormat;
|
||||
|
||||
var dict = new Dictionary<string, System.Object>();
|
||||
dict.Add("revenue", revenue);
|
||||
var dict = new Dictionary<string, string>();
|
||||
dict.Add("revenue", revenue.ToString());
|
||||
dict.Add("country_code", countryCode);
|
||||
dict.Add("network_name", networkName);
|
||||
dict.Add("ad_unit_Id", adUnitId);
|
||||
|
||||
@ -31,22 +31,10 @@ namespace BF
|
||||
|
||||
// SDK init
|
||||
BFLog.Log("unity-script: IronSource.Agent.init");
|
||||
// IronSource.Agent.setMetaData("is_test_suite", "enable");
|
||||
IronSource.Agent.init(appKey);
|
||||
IronSource.Agent.setManualLoadRewardedVideo(true);
|
||||
|
||||
// 初始化之前先设置一下用户id
|
||||
// ISAdQualityConfig adQualityConfig = new ISAdQualityConfig();
|
||||
// adQualityConfig.UserId = SystemInfo.deviceUniqueIdentifier;
|
||||
// // adQualityConfig.TestMode = true;
|
||||
// // adQualityConfig.LogLevel = ISAdQualityLogLevel.INFO;
|
||||
// IronSourceAdQuality.Initialize(appKey, adQualityConfig);
|
||||
#elif UNITY_IPHONE
|
||||
// string appKey = "8545d445";
|
||||
// 初始化之前先设置一下用户id
|
||||
// ISAdQualityConfig adQualityConfig = new ISAdQualityConfig();
|
||||
// adQualityConfig.UserId = SystemInfo.deviceUniqueIdentifier;
|
||||
// IronSourceAdQuality.Initialize(appKey, adQualityConfig);
|
||||
#else
|
||||
// string appKey = "unexpected_platform";
|
||||
#endif
|
||||
@ -156,8 +144,6 @@ namespace BF
|
||||
void SdkInitializationCompletedEvent()
|
||||
{
|
||||
BFLog.Log("unity-script: I got SdkInitializationCompletedEvent");
|
||||
//Launch test suite
|
||||
// IronSource.Agent.launchTestSuite();
|
||||
}
|
||||
|
||||
#endregion
|
||||
@ -286,8 +272,8 @@ namespace BF
|
||||
{
|
||||
return;
|
||||
}
|
||||
var dict = new Dictionary<string, System.Object>();
|
||||
dict.Add("revenue", revenue);
|
||||
var dict = new Dictionary<string, string>();
|
||||
dict.Add("revenue", revenue.ToString());
|
||||
dict.Add("auction_id", impressionData.auctionId);
|
||||
dict.Add("country_code", impressionData.country);
|
||||
dict.Add("network_name", impressionData.adNetwork);
|
||||
@ -301,7 +287,7 @@ namespace BF
|
||||
}
|
||||
if (!ReferenceEquals(impressionData.lifetimeRevenue, null))
|
||||
{
|
||||
dict.Add("lifetime_revenue", impressionData.lifetimeRevenue);
|
||||
dict.Add("lifetime_revenue", impressionData.lifetimeRevenue.ToString());
|
||||
}
|
||||
if (!string.IsNullOrEmpty(impressionData.encryptedCPM))
|
||||
{
|
||||
|
||||
@ -1,116 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
// using BF.NativeCore.Platform;
|
||||
|
||||
namespace BF
|
||||
{
|
||||
//copy from sdk
|
||||
public enum NotchType
|
||||
{
|
||||
NONE,
|
||||
ANDROID,
|
||||
}
|
||||
|
||||
[System.Serializable]
|
||||
public class NotchScreenInfo
|
||||
{
|
||||
public NotchType notchType = NotchType.NONE;
|
||||
public bool enabled = false;
|
||||
public int width = 0;
|
||||
public int height = 0;
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return string.Format("notchType:{0} showNotch:{1} width:{2} height:{3}", notchType, enabled, width, height);
|
||||
}
|
||||
}
|
||||
public class DZSDKManager : MonoBehaviour
|
||||
{
|
||||
|
||||
#if UNITY_ANDROID
|
||||
/// <summary>
|
||||
/// android原生代码对象
|
||||
/// </summary>
|
||||
AndroidJavaObject ajc;
|
||||
#endif
|
||||
//解析的数据
|
||||
private NotchScreenInfo notchScreenInfo = new NotchScreenInfo();
|
||||
private bool initNotchScreen = false;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
//通过该API来实例化导入的arr中对应的类
|
||||
ajc = new AndroidJavaObject("com.droidhang.aod.AODHelper");
|
||||
#endif
|
||||
}
|
||||
|
||||
public void CSGetNotchScreenInfo()
|
||||
{
|
||||
if (initNotchScreen) return;
|
||||
BFLog.Log("尝试获取适配信息 CSGetNotchScreenInfo");
|
||||
#if UNITY_ANDROID
|
||||
//通过API来调用原生代码的方法
|
||||
bool success = ajc.Call<bool>("getNotchScreen");
|
||||
if (success)
|
||||
{
|
||||
initNotchScreen = true;
|
||||
//请求成功
|
||||
BFLog.Log("获取安卓刘海屏成功");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 原生层通过该方法传回信息
|
||||
/// </summary>
|
||||
/// <param name="content"></param>
|
||||
public void GetNotchScreen(string content)
|
||||
{
|
||||
#if UNITY_ANDROID
|
||||
BFLog.Log("获取NotchInfo:" + content);
|
||||
|
||||
if (!string.IsNullOrEmpty(content))
|
||||
{
|
||||
//解析刘海屏数据
|
||||
notchScreenInfo = JsonUtility.FromJson<NotchScreenInfo>(content);
|
||||
|
||||
BFLog.Log("解析 NotchScreen:" + notchScreenInfo.ToString());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 对外接口 获取刘海屏信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public NotchScreenInfo GetNotchScreenInfo()
|
||||
{
|
||||
return notchScreenInfo;
|
||||
}
|
||||
|
||||
// 刘海屏信息 ***************************************************************************************************
|
||||
|
||||
public NotchType GetNotchScreenType()
|
||||
{
|
||||
return notchScreenInfo.notchType;
|
||||
}
|
||||
|
||||
public bool GetNotchScreenEnable()
|
||||
{
|
||||
return notchScreenInfo.enabled;
|
||||
}
|
||||
|
||||
public int GetNotchScreenWidth()
|
||||
{
|
||||
return notchScreenInfo.width;
|
||||
}
|
||||
|
||||
public int GetNotchScreenHeight()
|
||||
{
|
||||
return notchScreenInfo.height;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ced1766fcb78b314db1ae240a0e27a9f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,5 +1,5 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.20.1</unityversion>
|
||||
<unityversion>4.3.19.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.adcolony:sdk:4.8.0">
|
||||
<repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:adcolonyadapter:4.3.15">
|
||||
<androidPackage spec="com.ironsource.adapters:adcolonyadapter:4.3.14">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceAdColonyAdapter" version="4.3.17.1">
|
||||
<iosPod name="IronSourceAdColonyAdapter" version="4.3.16.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.54.0</unityversion>
|
||||
<unityversion>4.3.47.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.google.android.gms:play-services-ads:22.2.0">
|
||||
<androidPackage spec="com.google.android.gms:play-services-ads:21.5.0">
|
||||
<repositories>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:admobadapter:4.3.39">
|
||||
<androidPackage spec="com.ironsource.adapters:admobadapter:4.3.35">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceAdMobAdapter" version="4.3.47.0">
|
||||
<iosPod name="IronSourceAdMobAdapter" version="4.3.41.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.44.3</unityversion>
|
||||
<unityversion>4.3.42.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:applovinadapter:4.3.39">
|
||||
<androidPackage spec="com.ironsource.adapters:applovinadapter:4.3.37">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.applovin:applovin-sdk:11.10.1">
|
||||
<androidPackage spec="com.applovin:applovin-sdk:11.7.1">
|
||||
<repositories>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceAppLovinAdapter" version="4.3.40.3">
|
||||
<iosPod name="IronSourceAppLovinAdapter" version="4.3.38.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.19.2</unityversion>
|
||||
<unityversion>4.3.17.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:chartboostadapter:4.3.12">
|
||||
<androidPackage spec="com.ironsource.adapters:chartboostadapter:4.3.11">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.chartboost:chartboost-sdk:9.3.1">
|
||||
<androidPackage spec="com.chartboost:chartboost-sdk:9.2.0">
|
||||
<repositories>
|
||||
<repository>https://cboost.jfrog.io/artifactory/chartboost-ads/</repository>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceChartboostAdapter" version="4.3.15.2">
|
||||
<iosPod name="IronSourceChartboostAdapter" version="4.3.13.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.61.0</unityversion>
|
||||
<unityversion>4.3.52.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.facebook.android:audience-network-sdk:6.16.0">
|
||||
<androidPackage spec="com.facebook.android:audience-network-sdk:6.12.0">
|
||||
<repositories>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:facebookadapter:4.3.45">
|
||||
<androidPackage spec="com.ironsource.adapters:facebookadapter:4.3.39">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceFacebookAdapter" version="4.3.43.0">
|
||||
<iosPod name="IronSourceFacebookAdapter" version="4.3.39.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.38.0</unityversion>
|
||||
<unityversion>4.3.34.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.fyber:marketplace-sdk:8.2.4">
|
||||
<androidPackage spec="com.fyber:marketplace-sdk:8.2.2">
|
||||
<repositories>
|
||||
<repository>https://repo.maven.apache.org/maven2/</repository>
|
||||
</repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:fyberadapter:4.3.28">
|
||||
<androidPackage spec="com.ironsource.adapters:fyberadapter:4.3.24">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceFyberAdapter" version="4.3.31.1">
|
||||
<iosPod name="IronSourceFyberAdapter" version="4.3.28.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.19.0</unityversion>
|
||||
<unityversion>4.3.16.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:newinterstitial:16.5.21">
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:newinterstitial:16.4.41">
|
||||
<repositories>
|
||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||
</repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:reward:16.5.21">
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:reward:16.4.41">
|
||||
<repositories>
|
||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:mbbanner:16.5.21">
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:mbbanner:16.4.41">
|
||||
<repositories>
|
||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||
</repositories>
|
||||
@ -25,7 +25,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:mbbid:16.5.21">
|
||||
<androidPackage spec="com.mbridge.msdk.oversea:mbbid:16.4.41">
|
||||
<repositories>
|
||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea/</repository>
|
||||
</repositories>
|
||||
@ -41,7 +41,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:mintegraladapter:4.3.19">
|
||||
<androidPackage spec="com.ironsource.adapters:mintegraladapter:4.3.16">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -49,7 +49,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceMintegralAdapter" version="4.3.18.0">
|
||||
<iosPod name="IronSourceMintegralAdapter" version="4.3.15.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.27.0</unityversion>
|
||||
<unityversion>4.3.22.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:pangleadapter:4.3.22">
|
||||
<androidPackage spec="com.ironsource.adapters:pangleadapter:4.3.17">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.pangle.global:ads-sdk:5.5.0.5">
|
||||
<androidPackage spec="com.pangle.global:ads-sdk:5.0.0.8">
|
||||
<repositories>
|
||||
<repository>https://artifact.bytedance.com/repository/pangle/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourcePangleAdapter" version="4.3.24.0">
|
||||
<iosPod name="IronSourcePangleAdapter" version="4.3.19.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
<dependencies>
|
||||
<unityversion>4.1.30.3</unityversion>
|
||||
<unityversion>4.1.29.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:tapjoyadapter:4.1.25">
|
||||
<androidPackage spec="com.ironsource.adapters:tapjoyadapter:4.1.24">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.tapjoy:tapjoy-android-sdk:13.0.1">
|
||||
<androidPackage spec="com.tapjoy:tapjoy-android-sdk:12.11.1">
|
||||
<repositories>
|
||||
<repository>https://sdk.tapjoy.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceTapjoyAdapter" version="4.1.25.3">
|
||||
<iosPod name="IronSourceTapjoyAdapter" version="4.1.24.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.38.0</unityversion>
|
||||
<unityversion>4.3.32.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:unityadsadapter:4.3.33">
|
||||
<androidPackage spec="com.ironsource.adapters:unityadsadapter:4.3.27">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.unity3d.ads:unity-ads:4.9.1">
|
||||
<androidPackage spec="com.unity3d.ads:unity-ads:4.6.1">
|
||||
<repositories>
|
||||
<repository>https://maven.google.com/</repository>
|
||||
</repositories>
|
||||
@ -16,7 +16,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceUnityAdsAdapter" version="4.3.33.0">
|
||||
<iosPod name="IronSourceUnityAdsAdapter" version="4.3.28.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<dependencies>
|
||||
<unityversion>4.3.37.0</unityversion>
|
||||
<unityversion>4.3.33.0</unityversion>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.vungle:vungle-ads:7.0.0">
|
||||
<androidPackage spec="com.vungle:publisher-sdk-android:6.12.1">
|
||||
<repositories>
|
||||
<repository>https://jitpack.io/</repository>
|
||||
</repositories>
|
||||
@ -9,7 +9,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.adapters:vungleadapter:4.3.22">
|
||||
<androidPackage spec="com.ironsource.adapters:vungleadapter:4.3.20">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -17,7 +17,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceVungleAdapter" version="4.3.29.0">
|
||||
<iosPod name="IronSourceVungleAdapter" version="4.3.26.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
@ -220,7 +220,7 @@ public class IronSourceDependenciesManager : EditorWindow
|
||||
ProviderInfo info = new ProviderInfo();
|
||||
|
||||
object providerXML;
|
||||
var lowerCaseItem = item.Key.ToLower(new System.Globalization.CultureInfo("en"));
|
||||
var lowerCaseItem = item.Key.ToLower();
|
||||
|
||||
linksDictionary.TryGetValue(lowerCaseItem, out providerXML);
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ public class IronSourceManifestProcessor : IPreprocessBuild
|
||||
private const string AD_ID_PERMISSION_ATTR = "com.google.android.gms.permission.AD_ID";
|
||||
private const string MANIFEST_PERMISSION = "uses-permission";
|
||||
private const string MANIFEST_META_DATA = "meta-data";
|
||||
private const string IRONSOURCE_MANIFEST_PATH = "IronSource/Plugins/Android/IronSource.androidlib/AndroidManifest.xml";
|
||||
private const string IRONSOURCE_MANIFEST_PATH = "IronSource/Plugins/Android/IronSource.plugin/AndroidManifest.xml";
|
||||
private string manifestPath = "";
|
||||
private XNamespace ns = "http://schemas.android.com/apk/res/android";
|
||||
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<dependencies>
|
||||
<unityversion>7.5.1</unityversion>
|
||||
<unityversion>7.3.0.1</unityversion>
|
||||
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.ironsource.sdk:mediationsdk:7.5.1">
|
||||
<androidPackage spec="com.ironsource.sdk:mediationsdk:7.3.0.1">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
@ -26,7 +26,7 @@
|
||||
</androidPackages>
|
||||
|
||||
<!-- <iosPods>
|
||||
<iosPod name="IronSourceSDK" version="7.5.0.0">
|
||||
<iosPod name="IronSourceSDK" version="7.3.0.0">
|
||||
<sources>
|
||||
<source>https://github.com/CocoaPods/Specs</source>
|
||||
</sources>
|
||||
|
||||
BIN
Assets/ThirdParty/IronSource/Editor/IronSource_IntegrationManager.unitypackage
vendored
Normal file
BIN
Assets/ThirdParty/IronSource/Editor/IronSource_IntegrationManager.unitypackage
vendored
Normal file
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f6d91e910c9af49d7a1d0254340e9dca
|
||||
guid: 43f2c8ee7c4303948bbd5f896c515318
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 78bb03eee4d26fb4da4755f7e6529784
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,28 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 718f851be2f4c4ee9b4c748b225a7ea2
|
||||
folderAsset: yes
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 0
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
Any:
|
||||
second:
|
||||
enabled: 1
|
||||
settings: {}
|
||||
- first:
|
||||
Editor: Editor
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
DefaultValueInitialized: true
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.ironsource.unity">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<application>
|
||||
<!-- AdMob -->
|
||||
<!--As Requiered By Admob please add your App ID-->
|
||||
<!--<meta-data-->
|
||||
<!--android:name="com.google.android.gms.ads.APPLICATION_ID"-->
|
||||
<!--android:value="YOUR_ADMOB_APP_ID"/>-->
|
||||
</application>
|
||||
</manifest>
|
||||
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e46e3d39a8bec48d9ae81d0008842ad4
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,8 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5936d92d17be4fde864e068dd13d202
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
target=android-9
|
||||
android.library=true
|
||||
22
Assets/ThirdParty/IronSource/Scripts/AdFormat.cs
vendored
22
Assets/ThirdParty/IronSource/Scripts/AdFormat.cs
vendored
@ -1,22 +0,0 @@
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the available formats for displaying advertisements.
|
||||
/// </summary>
|
||||
public enum AdFormat
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a rewarded video ad format.
|
||||
/// </summary>
|
||||
RewardedVideo,
|
||||
|
||||
/// <summary>
|
||||
/// Represents an interstitial ad format.
|
||||
/// </summary>
|
||||
Interstitial,
|
||||
|
||||
/// <summary>
|
||||
/// Represents a banner ad format.
|
||||
/// </summary>
|
||||
Banner
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8124546645b9349f7858c4510ea7de78
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -2,20 +2,15 @@
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System;
|
||||
|
||||
public class AndroidAgent : IronSourceIAgent
|
||||
{
|
||||
static AndroidJavaObject _androidBridge;
|
||||
readonly static string AndroidBridge = "com.ironsource.unity.androidbridge.AndroidBridge";
|
||||
const string REWARD_AMOUNT = "reward_amount";
|
||||
const string REWARD_NAME = "reward_name";
|
||||
const string PLACEMENT_NAME = "placement_name";
|
||||
|
||||
const string WATERFALL_CONFIG_FLOOR = "floor";
|
||||
const string WATERFALL_CONFIG_CEILING = "ceiling";
|
||||
const string WATERFALL_CONFIG_API = "setWaterfallConfiguration";
|
||||
private static AndroidJavaObject _androidBridge;
|
||||
private readonly static string AndroidBridge = "com.ironsource.unity.androidbridge.AndroidBridge";
|
||||
private const string REWARD_AMOUNT = "reward_amount";
|
||||
private const string REWARD_NAME = "reward_name";
|
||||
private const string PLACEMENT_NAME = "placement_name";
|
||||
|
||||
public AndroidAgent ()
|
||||
{
|
||||
@ -39,48 +34,6 @@ public class AndroidAgent : IronSourceIAgent
|
||||
|
||||
//******************* Base API *******************//
|
||||
|
||||
/// <summary>
|
||||
/// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||
/// </summary>
|
||||
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||
public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||
{
|
||||
var ceiling = waterfallConfiguration.Ceiling;
|
||||
var floor = waterfallConfiguration.Floor;
|
||||
var dict = new Dictionary<string, string>();
|
||||
|
||||
if (ceiling.HasValue)
|
||||
{
|
||||
dict.Add(WATERFALL_CONFIG_CEILING, ceiling.Value.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
if (floor.HasValue)
|
||||
{
|
||||
dict.Add(WATERFALL_CONFIG_FLOOR, floor.Value.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
var json = IronSourceJSON.Json.Serialize(dict);
|
||||
string stringAdFormat;
|
||||
|
||||
switch (adFormat)
|
||||
{
|
||||
case AdFormat.RewardedVideo:
|
||||
stringAdFormat = "REWARDED_VIDEO";
|
||||
break;
|
||||
case AdFormat.Interstitial:
|
||||
stringAdFormat = "INTERSTITIAL";
|
||||
break;
|
||||
case AdFormat.Banner:
|
||||
stringAdFormat = "BANNER";
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
getBridge().Call(WATERFALL_CONFIG_API, json, stringAdFormat);
|
||||
}
|
||||
|
||||
public void onApplicationPause (bool pause)
|
||||
{
|
||||
if (pause)
|
||||
|
||||
@ -7,7 +7,7 @@ public class IronSource : IronSourceIAgent
|
||||
{
|
||||
private IronSourceIAgent _platformAgent;
|
||||
private static IronSource _instance;
|
||||
public static string UNITY_PLUGIN_VERSION = "7.5.1-r";
|
||||
public static string UNITY_PLUGIN_VERSION = "7.3.0.1-r";
|
||||
private static bool isUnsupportedPlatform;
|
||||
|
||||
private IronSource()
|
||||
@ -67,16 +67,6 @@ public class IronSource : IronSourceIAgent
|
||||
|
||||
//******************* Base API *******************//
|
||||
|
||||
/// <summary>
|
||||
/// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||
/// </summary>
|
||||
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||
public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||
{
|
||||
_platformAgent.SetWaterfallConfiguration(waterfallConfiguration, adFormat);
|
||||
}
|
||||
|
||||
public void onApplicationPause(bool pause)
|
||||
{
|
||||
_platformAgent.onApplicationPause(pause);
|
||||
@ -266,26 +256,22 @@ public class IronSource : IronSourceIAgent
|
||||
|
||||
//******************* Offerwall API *******************//
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public void showOfferwall()
|
||||
{
|
||||
_platformAgent.showOfferwall();
|
||||
}
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public void showOfferwall(string placementName)
|
||||
public void showOfferwall(string placementName)
|
||||
{
|
||||
_platformAgent.showOfferwall(placementName);
|
||||
}
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public void getOfferwallCredits()
|
||||
public void getOfferwallCredits()
|
||||
{
|
||||
_platformAgent.getOfferwallCredits();
|
||||
}
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public bool isOfferwallAvailable()
|
||||
public bool isOfferwallAvailable()
|
||||
{
|
||||
return _platformAgent.isOfferwallAvailable();
|
||||
}
|
||||
|
||||
@ -83,17 +83,11 @@ public class IronSourceEvents : MonoBehaviour
|
||||
[Obsolete("This API has been deprecated as of SDK 7.3.0.1", false)]
|
||||
public static event Action<string, IronSourceError> onInterstitialAdShowFailedDemandOnlyEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<bool> onOfferwallAvailableEvent;
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action onOfferwallOpenedEvent;
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<Dictionary<string, object>> onOfferwallAdCreditedEvent;
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<IronSourceError> onGetOfferwallCreditsFailedEvent;
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action onOfferwallClosedEvent;
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<IronSourceError> onOfferwallShowFailedEvent;
|
||||
|
||||
[Obsolete("This API has been deprecated as of SDK 7.3.0. Please use the alternate API in IronSourceBannerEvents listener instead.", false)]
|
||||
@ -1649,7 +1643,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action _onOfferwallOpenedEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action onOfferwallOpenedEvent
|
||||
{
|
||||
add
|
||||
@ -1679,7 +1672,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action<IronSourceError> _onOfferwallShowFailedEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<IronSourceError> onOfferwallShowFailedEvent
|
||||
{
|
||||
add
|
||||
@ -1710,7 +1702,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action _onOfferwallClosedEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action onOfferwallClosedEvent
|
||||
{
|
||||
add
|
||||
@ -1740,7 +1731,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action<IronSourceError> _onGetOfferwallCreditsFailedEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<IronSourceError> onGetOfferwallCreditsFailedEvent
|
||||
{
|
||||
add
|
||||
@ -1772,7 +1762,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action<Dictionary<string, object>> _onOfferwallAdCreditedEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<Dictionary<string, object>> onOfferwallAdCreditedEvent
|
||||
{
|
||||
add
|
||||
@ -1800,7 +1789,6 @@ public class IronSourceEvents : MonoBehaviour
|
||||
|
||||
private static event Action<bool> _onOfferwallAvailableEvent;
|
||||
|
||||
[Obsolete("This API call is for the ironSource Offerwall, which will soon be deprecated. Please migrate to the Tapjoy Offerwall using the 'Offerwall migration checklist'.", false)]
|
||||
public static event Action<bool> onOfferwallAvailableEvent
|
||||
{
|
||||
add
|
||||
|
||||
@ -4,13 +4,6 @@ public interface IronSourceIAgent
|
||||
{
|
||||
//******************* Base API *******************//
|
||||
|
||||
/// <summary>
|
||||
/// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||
/// </summary>
|
||||
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||
void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat);
|
||||
|
||||
void onApplicationPause(bool pause);
|
||||
|
||||
string getAdvertiserId();
|
||||
|
||||
@ -11,15 +11,6 @@ public class UnsupportedPlatformAgent : IronSourceIAgent
|
||||
|
||||
#region IronSourceAgent implementation
|
||||
|
||||
/// <summary>
|
||||
/// This function is not supported on the current platform and does nothing.
|
||||
/// </summary>
|
||||
/// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||
/// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||
public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||
{
|
||||
}
|
||||
|
||||
public void start()
|
||||
{
|
||||
}
|
||||
|
||||
@ -1,92 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
/// <summary>
|
||||
/// Configuration class which allows users to customize or filter a Waterfall.
|
||||
/// </summary>
|
||||
public class WaterfallConfiguration
|
||||
{
|
||||
readonly double? ceiling;
|
||||
readonly double? floor;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ceiling value.
|
||||
/// </summary>
|
||||
public double? Ceiling { get { return ceiling; } }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the floor value.
|
||||
/// </summary>
|
||||
public double? Floor { get { return floor; } }
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the WaterfallConfiguration class.
|
||||
/// </summary>
|
||||
/// <param name="ceiling">The ceiling value.</param>
|
||||
/// <param name="floor">The floor value.</param>
|
||||
private WaterfallConfiguration(double? ceiling, double? floor)
|
||||
{
|
||||
this.ceiling = ceiling;
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a builder for creating instances of WaterfallConfiguration.
|
||||
/// </summary>
|
||||
/// <returns>The WaterfallConfigurationBuilder.</returns>
|
||||
public static WaterfallConfigurationBuilder Builder()
|
||||
{
|
||||
return new WaterfallConfigurationBuilder();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an empty instance of WaterfallConfiguration.
|
||||
/// </summary>
|
||||
/// <returns>The empty WaterfallConfiguration.</returns>
|
||||
public static WaterfallConfiguration Empty()
|
||||
{
|
||||
return new WaterfallConfiguration(double.NaN, double.NaN);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builder class which to create a WaterfallConfiguration.
|
||||
/// </summary>
|
||||
public class WaterfallConfigurationBuilder
|
||||
{
|
||||
double? ceiling;
|
||||
double? floor;
|
||||
|
||||
internal WaterfallConfigurationBuilder() {}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the ceiling value.
|
||||
/// </summary>
|
||||
/// <param name="ceiling">The ceiling value.</param>
|
||||
/// <returns>The WaterfallConfigurationBuilder.</returns>
|
||||
public WaterfallConfigurationBuilder SetCeiling(double ceiling)
|
||||
{
|
||||
this.ceiling = ceiling;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets the floor value.
|
||||
/// </summary>
|
||||
/// <param name="floor">The floor value.</param>
|
||||
/// <returns>The WaterfallConfigurationBuilder.</returns>
|
||||
public WaterfallConfigurationBuilder SetFloor(double floor)
|
||||
{
|
||||
this.floor = floor;
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds an instance of WaterfallConfiguration based on the configured values.
|
||||
/// </summary>
|
||||
/// <returns>The created WaterfallConfiguration.</returns>
|
||||
public WaterfallConfiguration Build()
|
||||
{
|
||||
return new WaterfallConfiguration(ceiling, floor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 354652886a99945cba942b569effe7bb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
871
Assets/ThirdParty/IronSource/Scripts/iOSAgent.cs
vendored
871
Assets/ThirdParty/IronSource/Scripts/iOSAgent.cs
vendored
@ -1,533 +1,508 @@
|
||||
#if UNITY_IPHONE || UNITY_IOS
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
|
||||
|
||||
// public class iOSAgent : IronSourceIAgent
|
||||
// {
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetPluginData(string pluginType, string pluginVersion, string pluginFrameworkVersion);
|
||||
|
||||
// struct IOSWaterfallConfiguration
|
||||
// {
|
||||
// public double Floor;
|
||||
// public double Ceiling;
|
||||
// }
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern string CFGetAdvertiserId();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void LPPSetWaterfallConfiguration(IOSWaterfallConfiguration configurationParams, AdFormat adFormat);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFValidateIntegration();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetPluginData(string pluginType, string pluginVersion, string pluginFrameworkVersion);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShouldTrackNetworkState(bool track);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern string CFGetAdvertiserId();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFSetDynamicUserId(string dynamicUserId);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFValidateIntegration();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetAdaptersDebug(bool enabled);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShouldTrackNetworkState(bool track);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetMetaData(string key, string value);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFSetDynamicUserId(string dynamicUserId);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetMetaDataWithValues(string key, params string[] values);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetAdaptersDebug(bool enabled);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern string CFGetConversionValue();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetMetaData(string key, string value);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetManualLoadRewardedVideo(bool isOn);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetMetaDataWithValues(string key, params string[] values);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetNetworkData(string networkKey, string networkData);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern string CFGetConversionValue();
|
||||
// delegate void ISUnityPauseGame(bool pause);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void RegisterPauseGameFunction(bool pasue);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetManualLoadRewardedVideo(bool isOn);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetNetworkData(string networkKey, string networkData);
|
||||
// //******************* SDK Init *******************//
|
||||
|
||||
// delegate void ISUnityPauseGame(bool pause);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void RegisterPauseGameFunction(bool pasue);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetUserId(string userId);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFInit(string appKey);
|
||||
|
||||
// //******************* SDK Init *******************//
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFInitWithAdUnits(string appKey, params string[] adUnits);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetUserId(string userId);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFInitISDemandOnly(string appKey, params string[] adUnits);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFInit(string appKey);
|
||||
// //******************* RewardedVideo API *******************//
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFInitWithAdUnits(string appKey, params string[] adUnits);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadRewardedVideo();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFInitISDemandOnly(string appKey, params string[] adUnits);
|
||||
|
||||
// //******************* RewardedVideo API *******************//
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowRewardedVideo();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadRewardedVideo();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowRewardedVideoWithPlacementName(string placementName);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsRewardedVideoAvailable();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowRewardedVideo();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsRewardedVideoPlacementCapped(string placementName);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowRewardedVideoWithPlacementName(string placementName);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern string CFGetPlacementInfo(string placementName);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsRewardedVideoAvailable();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetRewardedVideoServerParameters(string jsonString);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsRewardedVideoPlacementCapped(string placementName);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFClearRewardedVideoServerParameters();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern string CFGetPlacementInfo(string placementName);
|
||||
// //******************* RewardedVideo DemandOnly API *******************//
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetRewardedVideoServerParameters(string jsonString);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowISDemandOnlyRewardedVideo(string instanceId);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFClearRewardedVideoServerParameters();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadISDemandOnlyRewardedVideo(string instanceId);
|
||||
|
||||
// //******************* RewardedVideo DemandOnly API *******************//
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsDemandOnlyRewardedVideoAvailable(string instanceId);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowISDemandOnlyRewardedVideo(string instanceId);
|
||||
// //******************* Interstitial API *******************//
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadISDemandOnlyRewardedVideo(string instanceId);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadInterstitial();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsDemandOnlyRewardedVideoAvailable(string instanceId);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowInterstitial();
|
||||
|
||||
// //******************* Interstitial API *******************//
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowInterstitialWithPlacementName(string placementName);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadInterstitial();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsInterstitialReady();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowInterstitial();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsInterstitialPlacementCapped(string placementName);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowInterstitialWithPlacementName(string placementName);
|
||||
// //******************* Interstitial DemandOnly API *******************//
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsInterstitialReady();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadISDemandOnlyInterstitial(string instanceId);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsInterstitialPlacementCapped(string placementName);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowISDemandOnlyInterstitial(string instanceId);
|
||||
|
||||
// //******************* Interstitial DemandOnly API *******************//
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsDemandOnlyInterstitialReady(string instanceId);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadISDemandOnlyInterstitial(string instanceId);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowISDemandOnlyInterstitial(string instanceId);
|
||||
// //******************* Offerwall API *******************//
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsDemandOnlyInterstitialReady(string instanceId);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowOfferwall();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowOfferwallWithPlacementName(string placementName);
|
||||
|
||||
// //******************* Offerwall API *******************//
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFGetOfferwallCredits();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowOfferwall();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsOfferwallAvailable();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowOfferwallWithPlacementName(string placementName);
|
||||
// //******************* Banner API *******************//
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFGetOfferwallCredits();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadBanner(string description, int width, int height, int position, string placementName, bool isAdaptive);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsOfferwallAvailable();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFDestroyBanner();
|
||||
|
||||
// //******************* Banner API *******************//
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFDisplayBanner();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadBanner(string description, int width, int height, int position, string placementName, bool isAdaptive);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFHideBanner();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFDestroyBanner();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsBannerPlacementCapped(string placementName);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFDisplayBanner();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetSegment(string json);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFHideBanner();
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetConsent(bool consent);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern bool CFIsBannerPlacementCapped(string placementName);
|
||||
// //******************* ConsentView API *******************//
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetSegment(string json);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadConsentViewWithType(string consentViewType);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetConsent(bool consent);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowConsentViewWithType(string consentViewType);
|
||||
|
||||
// //******************* ConsentView API *******************//
|
||||
// //******************* ILRD API *******************//
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLoadConsentViewWithType(string consentViewType);
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetAdRevenueData(string dataSource, string impressionData);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFShowConsentViewWithType(string consentViewType);
|
||||
// //******************* TestSuite API *******************//
|
||||
|
||||
// //******************* ILRD API *******************//
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLaunchTestSuite();
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFSetAdRevenueData(string dataSource, string impressionData);
|
||||
// public iOSAgent()
|
||||
// {
|
||||
// }
|
||||
|
||||
// //******************* TestSuite API *******************//
|
||||
// #region IronSourceIAgent implementation
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// private static extern void CFLaunchTestSuite();
|
||||
// //******************* Base API *******************//
|
||||
|
||||
// public iOSAgent()
|
||||
// {
|
||||
// }
|
||||
// public void onApplicationPause(bool pause)
|
||||
// {
|
||||
|
||||
// #region IronSourceIAgent implementation
|
||||
// }
|
||||
|
||||
// //******************* Base API *******************//
|
||||
// public string getAdvertiserId()
|
||||
// {
|
||||
// return CFGetAdvertiserId();
|
||||
// }
|
||||
|
||||
// /// <summary>
|
||||
// /// Allows publishers to set configurations for a waterfall of a given ad type.
|
||||
// /// </summary>
|
||||
// /// <param name="adFormat">The AdFormat for which to configure the waterfall.</param>
|
||||
// /// <param name="waterfallConfiguration">The configuration for the given ad types waterfall. </param>
|
||||
// public void SetWaterfallConfiguration(WaterfallConfiguration waterfallConfiguration, AdFormat adFormat)
|
||||
// {
|
||||
// var config = new IOSWaterfallConfiguration
|
||||
// {
|
||||
// Floor = waterfallConfiguration.Floor ?? 0.0,
|
||||
// Ceiling = waterfallConfiguration.Ceiling ?? 0.0
|
||||
// };
|
||||
// public void validateIntegration()
|
||||
// {
|
||||
// CFValidateIntegration();
|
||||
// }
|
||||
|
||||
// LPPSetWaterfallConfiguration(config, adFormat);
|
||||
// }
|
||||
// public void shouldTrackNetworkState(bool track)
|
||||
// {
|
||||
// CFShouldTrackNetworkState(track);
|
||||
// }
|
||||
|
||||
// public void onApplicationPause(bool pause)
|
||||
// {
|
||||
// public bool setDynamicUserId(string dynamicUserId)
|
||||
// {
|
||||
// return CFSetDynamicUserId(dynamicUserId);
|
||||
// }
|
||||
|
||||
// }
|
||||
// public void setAdaptersDebug(bool enabled)
|
||||
// {
|
||||
// CFSetAdaptersDebug(enabled);
|
||||
// }
|
||||
|
||||
// public string getAdvertiserId()
|
||||
// {
|
||||
// return CFGetAdvertiserId();
|
||||
// }
|
||||
// public void setMetaData(string key, params string[] values)
|
||||
// {
|
||||
// CFSetMetaDataWithValues(key, values);
|
||||
// }
|
||||
|
||||
// public void validateIntegration()
|
||||
// {
|
||||
// CFValidateIntegration();
|
||||
// }
|
||||
|
||||
// public void shouldTrackNetworkState(bool track)
|
||||
// {
|
||||
// CFShouldTrackNetworkState(track);
|
||||
// }
|
||||
|
||||
// public bool setDynamicUserId(string dynamicUserId)
|
||||
// {
|
||||
// return CFSetDynamicUserId(dynamicUserId);
|
||||
// }
|
||||
|
||||
// public void setAdaptersDebug(bool enabled)
|
||||
// {
|
||||
// CFSetAdaptersDebug(enabled);
|
||||
// }
|
||||
|
||||
// public void setMetaData(string key, params string[] values)
|
||||
// {
|
||||
// CFSetMetaDataWithValues(key, values);
|
||||
// }
|
||||
|
||||
// public void setMetaData(string key, string value)
|
||||
// {
|
||||
// CFSetMetaData(key, value);
|
||||
// }
|
||||
|
||||
// public int? getConversionValue()
|
||||
// {
|
||||
// CultureInfo invCulture = CultureInfo.InvariantCulture;
|
||||
// int parsedInt;
|
||||
// if (int.TryParse(string.Format(invCulture, "{0}", CFGetConversionValue()), NumberStyles.Any, invCulture, out parsedInt))
|
||||
// {
|
||||
// return parsedInt;
|
||||
// }
|
||||
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// public void setManualLoadRewardedVideo(bool isOn)
|
||||
// {
|
||||
// CFSetManualLoadRewardedVideo(isOn);
|
||||
// }
|
||||
|
||||
// public void setNetworkData(string networkKey, string networkData)
|
||||
// {
|
||||
// CFSetNetworkData(networkKey, networkData);
|
||||
// }
|
||||
|
||||
// [AOT.MonoPInvokeCallback(typeof(ISUnityPauseGame))]
|
||||
// public void SetPauseGame(bool pause)
|
||||
// {
|
||||
// RegisterPauseGameFunction(pause);
|
||||
// if (pause)
|
||||
// {
|
||||
// setMetaData("IS_PAUSE_GAME_FLAG", "true");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// setMetaData("IS_PAUSE_GAME_FLAG", "false");
|
||||
// }
|
||||
// }
|
||||
|
||||
// //******************* SDK Init *******************//
|
||||
|
||||
// public void setUserId(string userId)
|
||||
// {
|
||||
// CFSetUserId(userId);
|
||||
// }
|
||||
|
||||
// public void init(string appKey)
|
||||
// {
|
||||
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
||||
// CFInit(appKey);
|
||||
// }
|
||||
|
||||
// public void init(string appKey, params string[] adUnits)
|
||||
// {
|
||||
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
||||
// CFInitWithAdUnits(appKey, adUnits);
|
||||
// }
|
||||
|
||||
// public void initISDemandOnly(string appKey, params string[] adUnits)
|
||||
// {
|
||||
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
||||
// CFInitISDemandOnly(appKey, adUnits);
|
||||
// }
|
||||
|
||||
// //******************* RewardedVideo API *******************//
|
||||
|
||||
// public void loadRewardedVideo()
|
||||
// {
|
||||
// CFLoadRewardedVideo();
|
||||
// }
|
||||
|
||||
// public void showRewardedVideo()
|
||||
// {
|
||||
// CFShowRewardedVideo();
|
||||
// }
|
||||
|
||||
// public void showRewardedVideo(string placementName)
|
||||
// {
|
||||
// CFShowRewardedVideoWithPlacementName(placementName);
|
||||
// }
|
||||
|
||||
// public bool isRewardedVideoAvailable()
|
||||
// {
|
||||
// return CFIsRewardedVideoAvailable();
|
||||
// }
|
||||
|
||||
// public bool isRewardedVideoPlacementCapped(string placementName)
|
||||
// {
|
||||
// return CFIsRewardedVideoPlacementCapped(placementName);
|
||||
// }
|
||||
|
||||
// public IronSourcePlacement getPlacementInfo(string placementName)
|
||||
// {
|
||||
// IronSourcePlacement sp = null;
|
||||
|
||||
// string spString = CFGetPlacementInfo(placementName);
|
||||
// if (spString != null)
|
||||
// {
|
||||
// Dictionary<string, object> spDic = IronSourceJSON.Json.Deserialize(spString) as Dictionary<string, object>;
|
||||
// string pName = spDic["placement_name"].ToString();
|
||||
// string rewardName = spDic["reward_name"].ToString();
|
||||
// int rewardAmount = Convert.ToInt32(spDic["reward_amount"].ToString());
|
||||
// sp = new IronSourcePlacement(pName, rewardName, rewardAmount);
|
||||
// }
|
||||
|
||||
// return sp;
|
||||
// }
|
||||
|
||||
// public void setRewardedVideoServerParams(Dictionary<string, string> parameters)
|
||||
// {
|
||||
// string json = IronSourceJSON.Json.Serialize(parameters);
|
||||
// CFSetRewardedVideoServerParameters(json);
|
||||
// }
|
||||
|
||||
// public void clearRewardedVideoServerParams()
|
||||
// {
|
||||
// CFClearRewardedVideoServerParameters();
|
||||
// }
|
||||
|
||||
// //******************* RewardedVideo DemandOnly API *******************//
|
||||
|
||||
// public void showISDemandOnlyRewardedVideo(string instanceId)
|
||||
// {
|
||||
// CFShowISDemandOnlyRewardedVideo(instanceId);
|
||||
// }
|
||||
|
||||
// public void loadISDemandOnlyRewardedVideo(string instanceId)
|
||||
// {
|
||||
// CFLoadISDemandOnlyRewardedVideo(instanceId);
|
||||
// }
|
||||
|
||||
// public bool isISDemandOnlyRewardedVideoAvailable(string instanceId)
|
||||
// {
|
||||
// return CFIsDemandOnlyRewardedVideoAvailable(instanceId);
|
||||
// }
|
||||
|
||||
// //******************* Interstitial API *******************//
|
||||
|
||||
// public void loadInterstitial()
|
||||
// {
|
||||
// CFLoadInterstitial();
|
||||
// }
|
||||
|
||||
// public void showInterstitial()
|
||||
// {
|
||||
// CFShowInterstitial();
|
||||
// }
|
||||
|
||||
// public void showInterstitial(string placementName)
|
||||
// {
|
||||
// CFShowInterstitialWithPlacementName(placementName);
|
||||
// }
|
||||
|
||||
// public bool isInterstitialReady()
|
||||
// {
|
||||
// return CFIsInterstitialReady();
|
||||
// }
|
||||
|
||||
// public bool isInterstitialPlacementCapped(string placementName)
|
||||
// {
|
||||
// return CFIsInterstitialPlacementCapped(placementName);
|
||||
// }
|
||||
|
||||
// //******************* Interstitial DemandOnly API *******************//
|
||||
|
||||
// public void loadISDemandOnlyInterstitial(string instanceId)
|
||||
// {
|
||||
// CFLoadISDemandOnlyInterstitial(instanceId);
|
||||
// }
|
||||
|
||||
// public void showISDemandOnlyInterstitial(string instanceId)
|
||||
// {
|
||||
// CFShowISDemandOnlyInterstitial(instanceId);
|
||||
// }
|
||||
|
||||
// public bool isISDemandOnlyInterstitialReady(string instanceId)
|
||||
// {
|
||||
// return CFIsDemandOnlyInterstitialReady(instanceId);
|
||||
// }
|
||||
|
||||
// //******************* Offerwall API *******************//
|
||||
|
||||
// public void showOfferwall()
|
||||
// {
|
||||
// CFShowOfferwall();
|
||||
// }
|
||||
|
||||
// public void showOfferwall(string placementName)
|
||||
// {
|
||||
// CFShowOfferwallWithPlacementName(placementName);
|
||||
// }
|
||||
|
||||
// public void getOfferwallCredits()
|
||||
// {
|
||||
// CFGetOfferwallCredits();
|
||||
// }
|
||||
|
||||
// public bool isOfferwallAvailable()
|
||||
// {
|
||||
// return CFIsOfferwallAvailable();
|
||||
// }
|
||||
|
||||
// //******************* Banner API *******************//
|
||||
|
||||
// public void loadBanner(IronSourceBannerSize size, IronSourceBannerPosition position)
|
||||
// {
|
||||
// loadBanner(size, position, "");
|
||||
// }
|
||||
|
||||
// public void loadBanner(IronSourceBannerSize size, IronSourceBannerPosition position, string placementName)
|
||||
// {
|
||||
// CFLoadBanner(size.Description, (int)size.Width, (int)size.Height, (int)position, placementName, (bool)size.IsAdaptiveEnabled());
|
||||
// }
|
||||
|
||||
// public void destroyBanner()
|
||||
// {
|
||||
// CFDestroyBanner();
|
||||
// }
|
||||
|
||||
// public void displayBanner()
|
||||
// {
|
||||
// CFDisplayBanner();
|
||||
// }
|
||||
|
||||
// public void hideBanner()
|
||||
// {
|
||||
// CFHideBanner();
|
||||
// }
|
||||
|
||||
// public bool isBannerPlacementCapped(string placementName)
|
||||
// {
|
||||
// return CFIsBannerPlacementCapped(placementName);
|
||||
// }
|
||||
|
||||
// public void setSegment(IronSourceSegment segment)
|
||||
// {
|
||||
// Dictionary<string, string> dict = segment.getSegmentAsDict();
|
||||
// string json = IronSourceJSON.Json.Serialize(dict);
|
||||
// CFSetSegment(json);
|
||||
// }
|
||||
|
||||
// public void setConsent(bool consent)
|
||||
// {
|
||||
// CFSetConsent(consent);
|
||||
// }
|
||||
|
||||
// public void loadConsentViewWithType(string consentViewType)
|
||||
// {
|
||||
// CFLoadConsentViewWithType(consentViewType);
|
||||
// }
|
||||
|
||||
// public void showConsentViewWithType(string consentViewType)
|
||||
// {
|
||||
// CFShowConsentViewWithType(consentViewType);
|
||||
// }
|
||||
|
||||
// //******************* ILRD API *******************//
|
||||
|
||||
// public void setAdRevenueData(string dataSource, Dictionary<string, string> impressionData)
|
||||
// {
|
||||
// string json = IronSourceJSON.Json.Serialize(impressionData);
|
||||
// CFSetAdRevenueData(dataSource, json);
|
||||
// }
|
||||
|
||||
// //******************* TestSuite API *******************//
|
||||
|
||||
// public void launchTestSuite()
|
||||
// {
|
||||
// Debug.Log("iOSAgent: launching TestSuite");
|
||||
// CFLaunchTestSuite();
|
||||
// }
|
||||
|
||||
// #endregion
|
||||
// public void setMetaData(string key, string value)
|
||||
// {
|
||||
// CFSetMetaData(key, value);
|
||||
// }
|
||||
|
||||
// public int? getConversionValue()
|
||||
// {
|
||||
// CultureInfo invCulture = CultureInfo.InvariantCulture;
|
||||
// int parsedInt;
|
||||
// if (int.TryParse(string.Format(invCulture, "{0}", CFGetConversionValue()), NumberStyles.Any, invCulture, out parsedInt))
|
||||
// {
|
||||
// return parsedInt;
|
||||
// }
|
||||
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// public void setManualLoadRewardedVideo(bool isOn)
|
||||
// {
|
||||
// CFSetManualLoadRewardedVideo(isOn);
|
||||
// }
|
||||
|
||||
// public void setNetworkData(string networkKey, string networkData)
|
||||
// {
|
||||
// CFSetNetworkData(networkKey, networkData);
|
||||
// }
|
||||
|
||||
// [AOT.MonoPInvokeCallback(typeof(ISUnityPauseGame))]
|
||||
// public void SetPauseGame(bool pause)
|
||||
// {
|
||||
// RegisterPauseGameFunction(pause);
|
||||
// if (pause)
|
||||
// {
|
||||
// setMetaData("IS_PAUSE_GAME_FLAG", "true");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// setMetaData("IS_PAUSE_GAME_FLAG", "false");
|
||||
// }
|
||||
// }
|
||||
|
||||
// //******************* SDK Init *******************//
|
||||
|
||||
// public void setUserId(string userId)
|
||||
// {
|
||||
// CFSetUserId(userId);
|
||||
// }
|
||||
|
||||
// public void init(string appKey)
|
||||
// {
|
||||
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
||||
// CFInit(appKey);
|
||||
// }
|
||||
|
||||
// public void init(string appKey, params string[] adUnits)
|
||||
// {
|
||||
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
||||
// CFInitWithAdUnits(appKey, adUnits);
|
||||
// }
|
||||
|
||||
// public void initISDemandOnly(string appKey, params string[] adUnits)
|
||||
// {
|
||||
// CFSetPluginData("Unity", IronSource.pluginVersion(), IronSource.unityVersion());
|
||||
// Debug.Log("IntegrationHelper pluginVersion: " + IronSource.pluginVersion());
|
||||
// CFInitISDemandOnly(appKey, adUnits);
|
||||
// }
|
||||
|
||||
// //******************* RewardedVideo API *******************//
|
||||
|
||||
// public void loadRewardedVideo()
|
||||
// {
|
||||
// CFLoadRewardedVideo();
|
||||
// }
|
||||
|
||||
// public void showRewardedVideo()
|
||||
// {
|
||||
// CFShowRewardedVideo();
|
||||
// }
|
||||
|
||||
// public void showRewardedVideo(string placementName)
|
||||
// {
|
||||
// CFShowRewardedVideoWithPlacementName(placementName);
|
||||
// }
|
||||
|
||||
// public bool isRewardedVideoAvailable()
|
||||
// {
|
||||
// return CFIsRewardedVideoAvailable();
|
||||
// }
|
||||
|
||||
// public bool isRewardedVideoPlacementCapped(string placementName)
|
||||
// {
|
||||
// return CFIsRewardedVideoPlacementCapped(placementName);
|
||||
// }
|
||||
|
||||
// public IronSourcePlacement getPlacementInfo(string placementName)
|
||||
// {
|
||||
// IronSourcePlacement sp = null;
|
||||
|
||||
// string spString = CFGetPlacementInfo(placementName);
|
||||
// if (spString != null)
|
||||
// {
|
||||
// Dictionary<string, object> spDic = IronSourceJSON.Json.Deserialize(spString) as Dictionary<string, object>;
|
||||
// string pName = spDic["placement_name"].ToString();
|
||||
// string rewardName = spDic["reward_name"].ToString();
|
||||
// int rewardAmount = Convert.ToInt32(spDic["reward_amount"].ToString());
|
||||
// sp = new IronSourcePlacement(pName, rewardName, rewardAmount);
|
||||
// }
|
||||
|
||||
// return sp;
|
||||
// }
|
||||
|
||||
// public void setRewardedVideoServerParams(Dictionary<string, string> parameters)
|
||||
// {
|
||||
// string json = IronSourceJSON.Json.Serialize(parameters);
|
||||
// CFSetRewardedVideoServerParameters(json);
|
||||
// }
|
||||
|
||||
// public void clearRewardedVideoServerParams()
|
||||
// {
|
||||
// CFClearRewardedVideoServerParameters();
|
||||
// }
|
||||
|
||||
// //******************* RewardedVideo DemandOnly API *******************//
|
||||
|
||||
// public void showISDemandOnlyRewardedVideo(string instanceId)
|
||||
// {
|
||||
// CFShowISDemandOnlyRewardedVideo(instanceId);
|
||||
// }
|
||||
|
||||
// public void loadISDemandOnlyRewardedVideo(string instanceId)
|
||||
// {
|
||||
// CFLoadISDemandOnlyRewardedVideo(instanceId);
|
||||
// }
|
||||
|
||||
// public bool isISDemandOnlyRewardedVideoAvailable(string instanceId)
|
||||
// {
|
||||
// return CFIsDemandOnlyRewardedVideoAvailable(instanceId);
|
||||
// }
|
||||
|
||||
// //******************* Interstitial API *******************//
|
||||
|
||||
// public void loadInterstitial()
|
||||
// {
|
||||
// CFLoadInterstitial();
|
||||
// }
|
||||
|
||||
// public void showInterstitial()
|
||||
// {
|
||||
// CFShowInterstitial();
|
||||
// }
|
||||
|
||||
// public void showInterstitial(string placementName)
|
||||
// {
|
||||
// CFShowInterstitialWithPlacementName(placementName);
|
||||
// }
|
||||
|
||||
// public bool isInterstitialReady()
|
||||
// {
|
||||
// return CFIsInterstitialReady();
|
||||
// }
|
||||
|
||||
// public bool isInterstitialPlacementCapped(string placementName)
|
||||
// {
|
||||
// return CFIsInterstitialPlacementCapped(placementName);
|
||||
// }
|
||||
|
||||
// //******************* Interstitial DemandOnly API *******************//
|
||||
|
||||
// public void loadISDemandOnlyInterstitial(string instanceId)
|
||||
// {
|
||||
// CFLoadISDemandOnlyInterstitial(instanceId);
|
||||
// }
|
||||
|
||||
// public void showISDemandOnlyInterstitial(string instanceId)
|
||||
// {
|
||||
// CFShowISDemandOnlyInterstitial(instanceId);
|
||||
// }
|
||||
|
||||
// public bool isISDemandOnlyInterstitialReady(string instanceId)
|
||||
// {
|
||||
// return CFIsDemandOnlyInterstitialReady(instanceId);
|
||||
// }
|
||||
|
||||
// //******************* Offerwall API *******************//
|
||||
|
||||
// public void showOfferwall()
|
||||
// {
|
||||
// CFShowOfferwall();
|
||||
// }
|
||||
|
||||
// public void showOfferwall(string placementName)
|
||||
// {
|
||||
// CFShowOfferwallWithPlacementName(placementName);
|
||||
// }
|
||||
|
||||
// public void getOfferwallCredits()
|
||||
// {
|
||||
// CFGetOfferwallCredits();
|
||||
// }
|
||||
|
||||
// public bool isOfferwallAvailable()
|
||||
// {
|
||||
// return CFIsOfferwallAvailable();
|
||||
// }
|
||||
|
||||
// //******************* Banner API *******************//
|
||||
|
||||
// public void loadBanner(IronSourceBannerSize size, IronSourceBannerPosition position)
|
||||
// {
|
||||
// loadBanner(size, position, "");
|
||||
// }
|
||||
|
||||
// public void loadBanner(IronSourceBannerSize size, IronSourceBannerPosition position, string placementName)
|
||||
// {
|
||||
// CFLoadBanner(size.Description, (int)size.Width, (int)size.Height, (int)position, placementName, (bool)size.IsAdaptiveEnabled());
|
||||
// }
|
||||
|
||||
// public void destroyBanner()
|
||||
// {
|
||||
// CFDestroyBanner();
|
||||
// }
|
||||
|
||||
// public void displayBanner()
|
||||
// {
|
||||
// CFDisplayBanner();
|
||||
// }
|
||||
|
||||
// public void hideBanner()
|
||||
// {
|
||||
// CFHideBanner();
|
||||
// }
|
||||
|
||||
// public bool isBannerPlacementCapped(string placementName)
|
||||
// {
|
||||
// return CFIsBannerPlacementCapped(placementName);
|
||||
// }
|
||||
|
||||
// public void setSegment(IronSourceSegment segment)
|
||||
// {
|
||||
// Dictionary<string, string> dict = segment.getSegmentAsDict();
|
||||
// string json = IronSourceJSON.Json.Serialize(dict);
|
||||
// CFSetSegment(json);
|
||||
// }
|
||||
|
||||
// public void setConsent(bool consent)
|
||||
// {
|
||||
// CFSetConsent(consent);
|
||||
// }
|
||||
|
||||
// public void loadConsentViewWithType(string consentViewType)
|
||||
// {
|
||||
// CFLoadConsentViewWithType(consentViewType);
|
||||
// }
|
||||
|
||||
// public void showConsentViewWithType(string consentViewType)
|
||||
// {
|
||||
// CFShowConsentViewWithType(consentViewType);
|
||||
// }
|
||||
|
||||
// //******************* ILRD API *******************//
|
||||
|
||||
// public void setAdRevenueData(string dataSource, Dictionary<string, string> impressionData)
|
||||
// {
|
||||
// string json = IronSourceJSON.Json.Serialize(impressionData);
|
||||
// CFSetAdRevenueData(dataSource, json);
|
||||
// }
|
||||
|
||||
// //******************* TestSuite API *******************//
|
||||
|
||||
// public void launchTestSuite()
|
||||
// {
|
||||
// Debug.Log("iOSAgent: launching TestSuite");
|
||||
// CFLaunchTestSuite();
|
||||
// }
|
||||
|
||||
// #endregion
|
||||
// }
|
||||
#endif
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<androidPackages>
|
||||
<androidPackage spec="com.applovin:applovin-sdk:11.10.1" />
|
||||
<androidPackage spec="com.applovin:applovin-sdk:11.4.4" />
|
||||
</androidPackages>
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinSDK" version="11.10.1" />
|
||||
<iosPod name="AppLovinSDK" version="11.4.3" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -16,7 +16,6 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
||||
|
||||
- (void)createBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier atPosition:(NSString *)bannerPosition;
|
||||
- (void)createBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset;
|
||||
- (void)loadBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)setBannerBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode;
|
||||
- (void)setBannerPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)startBannerAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
@ -35,7 +34,6 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
||||
|
||||
- (void)createMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier atPosition:(NSString *)mrecPosition;
|
||||
- (void)createMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier x:(CGFloat)xOffset y:(CGFloat)yOffset;
|
||||
- (void)loadMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)setMRecPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)startMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)stopMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifer;
|
||||
@ -63,12 +61,6 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
||||
- (void)setInterstitialExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value;
|
||||
- (void)setInterstitialLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable id)value;
|
||||
|
||||
- (void)loadAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (BOOL)isAppOpenAdReadyWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)showAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData;
|
||||
- (void)setAppOpenAdExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value;
|
||||
- (void)setAppOpenAdLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable id)value;
|
||||
|
||||
- (void)loadRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (BOOL)isRewardedAdReadyWithAdUnitIdentifier:(NSString *)adUnitIdentifier;
|
||||
- (void)showRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData;
|
||||
@ -93,11 +85,8 @@ typedef void (*ALUnityBackgroundCallback)(const char* args);
|
||||
// User Service
|
||||
- (void)didDismissUserConsentDialog;
|
||||
|
||||
// Consent Flow
|
||||
- (void)startConsentFlow;
|
||||
|
||||
// Utils
|
||||
+ (NSString *)serializeParameters:(NSDictionary<NSString *, id> *)dict;
|
||||
+ (NSString *)serializeParameters:(NSDictionary<NSString *, NSString *> *)dict;
|
||||
|
||||
/**
|
||||
* Creates an instance of @c MAUnityAdManager if needed and returns the singleton instance.
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 4209563f82b8a4f7dabf03705ab761c6
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.h
|
||||
- al_max_export_path-MaxSdk\AppLovin\Plugins\iOS\MAUnityAdManager.h
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@ -15,7 +16,7 @@ PluginImporter:
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
'': Any
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
#import "MAUnityAdManager.h"
|
||||
|
||||
#define VERSION @"5.10.1"
|
||||
#define VERSION @"5.4.5"
|
||||
|
||||
#define KEY_WINDOW [UIApplication sharedApplication].keyWindow
|
||||
#define DEVICE_SPECIFIC_ADVIEW_AD_FORMAT ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) ? MAAdFormat.leader : MAAdFormat.banner
|
||||
@ -42,14 +42,13 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
@interface MAUnityAdManager()<MAAdDelegate, MAAdViewAdDelegate, MARewardedAdDelegate, MAAdRevenueDelegate, MAAdReviewDelegate, ALVariableServiceDelegate>
|
||||
@interface MAUnityAdManager()<MAAdDelegate, MAAdViewAdDelegate, MARewardedAdDelegate, MAAdRevenueDelegate, ALVariableServiceDelegate>
|
||||
|
||||
// Parent Fields
|
||||
@property (nonatomic, weak) ALSdk *sdk;
|
||||
|
||||
// Fullscreen Ad Fields
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MAInterstitialAd *> *interstitials;
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MAAppOpenAd *> *appOpenAds;
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MARewardedAd *> *rewardedAds;
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, MARewardedInterstitialAd *> *rewardedInterstitialAds;
|
||||
|
||||
@ -68,7 +67,6 @@ extern "C" {
|
||||
@property (nonatomic, strong) NSMutableDictionary<NSString *, NSString *> *adViewCustomDataToSetAfterCreate;
|
||||
@property (nonatomic, strong) NSMutableArray<NSString *> *adUnitIdentifiersToShowAfterCreate;
|
||||
@property (nonatomic, strong) NSMutableSet<NSString *> *disabledAdaptiveBannerAdUnitIdentifiers;
|
||||
@property (nonatomic, strong) NSMutableSet<NSString *> *disabledAutoRefreshAdViewAdUnitIdentifiers;
|
||||
@property (nonatomic, strong) UIView *safeAreaBackground;
|
||||
@property (nonatomic, strong, nullable) UIColor *publisherBannerBackgroundColor;
|
||||
|
||||
@ -109,7 +107,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
if ( self )
|
||||
{
|
||||
self.interstitials = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
self.appOpenAds = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
self.rewardedAds = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
self.rewardedInterstitialAds = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
self.adViews = [NSMutableDictionary dictionaryWithCapacity: 2];
|
||||
@ -126,7 +123,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
self.adViewCustomDataToSetAfterCreate = [NSMutableDictionary dictionaryWithCapacity: 1];
|
||||
self.adUnitIdentifiersToShowAfterCreate = [NSMutableArray arrayWithCapacity: 2];
|
||||
self.disabledAdaptiveBannerAdUnitIdentifiers = [NSMutableSet setWithCapacity: 2];
|
||||
self.disabledAutoRefreshAdViewAdUnitIdentifiers = [NSMutableSet setWithCapacity: 2];
|
||||
self.adInfoDict = [NSMutableDictionary dictionary];
|
||||
self.adInfoDictLock = [[NSObject alloc] init];
|
||||
|
||||
@ -176,15 +172,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
backgroundCallback = unityBackgroundCallback;
|
||||
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
|
||||
NSString *sdkKey = infoDict[@"AppLovinSdkKey"];
|
||||
if ( [sdkKey al_isValidString] )
|
||||
{
|
||||
self.sdk = [ALSdk sharedWithKey: sdkKey settings: [self generateSDKSettingsForAdUnitIdentifiers: serializedAdUnitIdentifiers metaData: serializedMetaData]];
|
||||
}
|
||||
else
|
||||
{
|
||||
self.sdk = [ALSdk sharedWithSettings:[self generateSDKSettingsForAdUnitIdentifiers:serializedAdUnitIdentifiers metaData:serializedMetaData]];
|
||||
}
|
||||
|
||||
self.sdk = [ALSdk sharedWithKey: sdkKey settings: [self generateSDKSettingsForAdUnitIdentifiers: serializedAdUnitIdentifiers metaData: serializedMetaData]];
|
||||
self.sdk.variableService.delegate = self;
|
||||
[self.sdk setPluginVersion: [@"Max-Unity-" stringByAppendingString: VERSION]];
|
||||
self.sdk.mediationProvider = @"max";
|
||||
@ -199,8 +187,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
@"consentDialogState" : consentDialogStateStr,
|
||||
@"countryCode" : configuration.countryCode,
|
||||
@"appTrackingStatus" : appTrackingStatus,
|
||||
@"isSuccessfullyInitialized" : @([self.sdk isInitialized]),
|
||||
@"isTestModeEnabled" : @([configuration isTestModeEnabled])}];
|
||||
@"isSuccessfullyInitialized" : ([self.sdk isInitialized] ? @"true" : @"false")}];
|
||||
}];
|
||||
|
||||
return self.sdk;
|
||||
@ -218,11 +205,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier] atPosition: DEFAULT_AD_VIEW_POSITION withOffset: CGPointMake(xOffset, yOffset)];
|
||||
}
|
||||
|
||||
- (void)loadBannerWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
[self loadAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier]];
|
||||
}
|
||||
|
||||
- (void)setBannerBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier hexColorCode:(NSString *)hexColorCode
|
||||
{
|
||||
[self setAdViewBackgroundColorForAdUnitIdentifier: adUnitIdentifier adFormat: [self adViewAdFormatForAdUnitIdentifier: adUnitIdentifier] hexColorCode: hexColorCode];
|
||||
@ -310,11 +292,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[self createAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec atPosition: DEFAULT_AD_VIEW_POSITION withOffset: CGPointMake(xOffset, yOffset)];
|
||||
}
|
||||
|
||||
- (void)loadMRecWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
[self loadAdViewWithAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||
}
|
||||
|
||||
- (void)setMRecPlacement:(nullable NSString *)placement forAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
[self setAdViewPlacement: placement forAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||
@ -325,9 +302,9 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[self startAdViewAutoRefreshForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||
}
|
||||
|
||||
- (void)stopMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
- (void)stopMRecAutoRefreshForAdUnitIdentifier:(NSString *)adUnitIdentifer
|
||||
{
|
||||
[self stopAdViewAutoRefreshForAdUnitIdentifier: adUnitIdentifier adFormat: MAAdFormat.mrec];
|
||||
[self stopAdViewAutoRefreshForAdUnitIdentifier: adUnitIdentifer adFormat: MAAdFormat.mrec];
|
||||
}
|
||||
|
||||
- (void)updateMRecPosition:(NSString *)mrecPosition forAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
@ -450,38 +427,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[interstitial setLocalExtraParameterForKey: key value: value];
|
||||
}
|
||||
|
||||
#pragma mark - App Open Ads
|
||||
|
||||
- (void)loadAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||
[appOpenAd loadAd];
|
||||
}
|
||||
|
||||
- (BOOL)isAppOpenAdReadyWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||
return [appOpenAd isReady];
|
||||
}
|
||||
|
||||
- (void)showAppOpenAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier placement:(nullable NSString *)placement customData:(nullable NSString *)customData
|
||||
{
|
||||
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||
[appOpenAd showAdForPlacement: placement customData: customData];
|
||||
}
|
||||
|
||||
- (void)setAppOpenAdExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable NSString *)value
|
||||
{
|
||||
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||
[appOpenAd setExtraParameterForKey: key value: value];
|
||||
}
|
||||
|
||||
- (void)setAppOpenAdLocalExtraParameterForAdUnitIdentifier:(NSString *)adUnitIdentifier key:(NSString *)key value:(nullable id)value
|
||||
{
|
||||
MAAppOpenAd *appOpenAd = [self retrieveAppOpenAdForAdUnitIdentifier: adUnitIdentifier];
|
||||
[appOpenAd setLocalExtraParameterForKey: key value: value];
|
||||
}
|
||||
|
||||
#pragma mark - Rewarded
|
||||
|
||||
- (void)loadRewardedAdWithAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
@ -623,7 +568,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
}
|
||||
|
||||
networkResponseDict[@"credentials"] = response.credentials;
|
||||
networkResponseDict[@"isBidding"] = @([response isBidding]);
|
||||
|
||||
MAError *error = response.error;
|
||||
if ( error )
|
||||
@ -692,10 +636,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialLoadedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdLoadedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdLoadedEvent";
|
||||
@ -748,10 +688,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialLoadFailedEvent";
|
||||
}
|
||||
else if ( self.appOpenAds[adUnitIdentifier] )
|
||||
{
|
||||
name = @"OnAppOpenAdLoadFailedEvent";
|
||||
}
|
||||
else if ( self.rewardedAds[adUnitIdentifier] )
|
||||
{
|
||||
name = @"OnRewardedAdLoadFailedEvent";
|
||||
@ -799,10 +735,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialClickedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdClickedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdClickedEvent";
|
||||
@ -836,10 +768,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialDisplayedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdDisplayedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdDisplayedEvent";
|
||||
@ -864,10 +792,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialAdFailedToDisplayEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdFailedToDisplayEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdFailedToDisplayEvent";
|
||||
@ -901,10 +825,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialHiddenEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdHiddenEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdHiddenEvent";
|
||||
@ -1032,10 +952,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
{
|
||||
name = @"OnInterstitialAdRevenuePaidEvent";
|
||||
}
|
||||
else if ( MAAdFormat.appOpen == adFormat )
|
||||
{
|
||||
name = @"OnAppOpenAdRevenuePaidEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdRevenuePaidEvent";
|
||||
@ -1054,41 +970,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[MAUnityAdManager forwardUnityEventWithArgs: args forwardInBackground: [adFormat isFullscreenAd]];
|
||||
}
|
||||
|
||||
- (void)didGenerateCreativeIdentifier:(NSString *)creativeIdentifier forAd:(MAAd *)ad
|
||||
{
|
||||
NSString *name;
|
||||
MAAdFormat *adFormat = ad.format;
|
||||
if ( MAAdFormat.banner == adFormat || MAAdFormat.leader == adFormat )
|
||||
{
|
||||
name = @"OnBannerAdReviewCreativeIdGeneratedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.mrec == adFormat )
|
||||
{
|
||||
name = @"OnMRecAdReviewCreativeIdGeneratedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.interstitial == adFormat )
|
||||
{
|
||||
name = @"OnInterstitialAdReviewCreativeIdGeneratedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewarded == adFormat )
|
||||
{
|
||||
name = @"OnRewardedAdReviewCreativeIdGeneratedEvent";
|
||||
}
|
||||
else if ( MAAdFormat.rewardedInterstitial == adFormat )
|
||||
{
|
||||
name = @"OnRewardedInterstitialAdReviewCreativeIdGeneratedEvent";
|
||||
}
|
||||
else
|
||||
{
|
||||
[self logInvalidAdFormat: adFormat];
|
||||
return;
|
||||
}
|
||||
|
||||
NSMutableDictionary<NSString *, id> *args = [self defaultAdEventParametersForName: name withAd: ad];
|
||||
args[@"adReviewCreativeId"] = creativeIdentifier;
|
||||
[MAUnityAdManager forwardUnityEventWithArgs: args];
|
||||
}
|
||||
|
||||
- (NSMutableDictionary<NSString *, id> *)defaultAdEventParametersForName:(NSString *)name withAd:(MAAd *)ad
|
||||
{
|
||||
NSMutableDictionary<NSString *, id> *args = [[self adInfoForAd: ad] mutableCopy];
|
||||
@ -1104,11 +985,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
max_unity_dispatch_on_main_thread(^{
|
||||
[self log: @"Creating %@ with ad unit identifier \"%@\" and position: \"%@\"", adFormat, adUnitIdentifier, adViewPosition];
|
||||
|
||||
if ( self.adViews[adUnitIdentifier] )
|
||||
{
|
||||
[self log: @"Trying to create a %@ that was already created. This will cause the current ad to be hidden.", adFormat.label];
|
||||
}
|
||||
|
||||
// Retrieve ad view from the map
|
||||
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat atPosition: adViewPosition withOffset: offset];
|
||||
adView.hidden = YES;
|
||||
@ -1164,12 +1040,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
|
||||
[adView loadAd];
|
||||
|
||||
// Disable auto-refresh if publisher sets it before creating the ad view.
|
||||
if ( [self.disabledAutoRefreshAdViewAdUnitIdentifiers containsObject: adUnitIdentifier] )
|
||||
{
|
||||
[adView stopAutoRefresh];
|
||||
}
|
||||
|
||||
// The publisher may have requested to show the banner before it was created. Now that the banner is created, show it.
|
||||
if ( [self.adUnitIdentifiersToShowAfterCreate containsObject: adUnitIdentifier] )
|
||||
{
|
||||
@ -1179,32 +1049,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
});
|
||||
}
|
||||
|
||||
- (void)loadAdViewWithAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat
|
||||
{
|
||||
max_unity_dispatch_on_main_thread(^{
|
||||
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||
if ( !adView )
|
||||
{
|
||||
[self log: @"%@ does not exist for ad unit identifier %@.", adFormat.label, adUnitIdentifier];
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ![self.disabledAutoRefreshAdViewAdUnitIdentifiers containsObject: adUnitIdentifier] )
|
||||
{
|
||||
if ( [adView isHidden] )
|
||||
{
|
||||
[self log: @"Auto-refresh will resume when the %@ ad is shown. You should only call LoadBanner() or LoadMRec() if you explicitly pause auto-refresh and want to manually load an ad.", adFormat.label];
|
||||
return;
|
||||
}
|
||||
|
||||
[self log: @"You must stop auto-refresh if you want to manually load %@ ads.", adFormat.label];
|
||||
return;
|
||||
}
|
||||
|
||||
[adView loadAd];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)setAdViewBackgroundColorForAdUnitIdentifier:(NSString *)adUnitIdentifier adFormat:(MAAdFormat *)adFormat hexColorCode:(NSString *)hexColorCode
|
||||
{
|
||||
max_unity_dispatch_on_main_thread(^{
|
||||
@ -1238,8 +1082,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
max_unity_dispatch_on_main_thread(^{
|
||||
[self log: @"Starting %@ auto refresh for ad unit identifier \"%@\"", adFormat.label, adUnitIdentifier];
|
||||
|
||||
[self.disabledAutoRefreshAdViewAdUnitIdentifiers removeObject: adUnitIdentifier];
|
||||
|
||||
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||
if ( !adView )
|
||||
{
|
||||
@ -1256,8 +1098,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
max_unity_dispatch_on_main_thread(^{
|
||||
[self log: @"Stopping %@ auto refresh for ad unit identifier \"%@\"", adFormat.label, adUnitIdentifier];
|
||||
|
||||
[self.disabledAutoRefreshAdViewAdUnitIdentifiers addObject: adUnitIdentifier];
|
||||
|
||||
MAAdView *adView = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||
if ( !adView )
|
||||
{
|
||||
@ -1432,10 +1272,7 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
self.safeAreaBackground.hidden = NO;
|
||||
view.hidden = NO;
|
||||
|
||||
if ( ![self.disabledAutoRefreshAdViewAdUnitIdentifiers containsObject: adUnitIdentifier] )
|
||||
{
|
||||
[view startAutoRefresh];
|
||||
}
|
||||
[view startAutoRefresh];
|
||||
});
|
||||
}
|
||||
|
||||
@ -1480,7 +1317,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
MAAdView *view = [self retrieveAdViewForAdUnitIdentifier: adUnitIdentifier adFormat: adFormat];
|
||||
view.delegate = nil;
|
||||
view.revenueDelegate = nil;
|
||||
view.adReviewDelegate = nil;
|
||||
|
||||
[view removeFromSuperview];
|
||||
|
||||
@ -1519,7 +1355,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
result = [[MAInterstitialAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||
result.delegate = self;
|
||||
result.revenueDelegate = self;
|
||||
result.adReviewDelegate = self;
|
||||
|
||||
self.interstitials[adUnitIdentifier] = result;
|
||||
}
|
||||
@ -1527,21 +1362,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
return result;
|
||||
}
|
||||
|
||||
- (MAAppOpenAd *)retrieveAppOpenAdForAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
MAAppOpenAd *result = self.appOpenAds[adUnitIdentifier];
|
||||
if ( !result )
|
||||
{
|
||||
result = [[MAAppOpenAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||
result.delegate = self;
|
||||
result.revenueDelegate = self;
|
||||
|
||||
self.appOpenAds[adUnitIdentifier] = result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (MARewardedAd *)retrieveRewardedAdForAdUnitIdentifier:(NSString *)adUnitIdentifier
|
||||
{
|
||||
MARewardedAd *result = self.rewardedAds[adUnitIdentifier];
|
||||
@ -1550,7 +1370,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
result = [MARewardedAd sharedWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||
result.delegate = self;
|
||||
result.revenueDelegate = self;
|
||||
result.adReviewDelegate = self;
|
||||
|
||||
self.rewardedAds[adUnitIdentifier] = result;
|
||||
}
|
||||
@ -1566,7 +1385,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
result = [[MARewardedInterstitialAd alloc] initWithAdUnitIdentifier: adUnitIdentifier sdk: self.sdk];
|
||||
result.delegate = self;
|
||||
result.revenueDelegate = self;
|
||||
result.adReviewDelegate = self;
|
||||
|
||||
self.rewardedInterstitialAds[adUnitIdentifier] = result;
|
||||
}
|
||||
@ -1590,7 +1408,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
result.translatesAutoresizingMaskIntoConstraints = NO;
|
||||
result.delegate = self;
|
||||
result.revenueDelegate = self;
|
||||
result.adReviewDelegate = self;
|
||||
|
||||
self.adViews[adUnitIdentifier] = result;
|
||||
self.adViewPositions[adUnitIdentifier] = adViewPosition;
|
||||
@ -1598,9 +1415,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
|
||||
UIViewController *rootViewController = [self unityViewController];
|
||||
[rootViewController.view addSubview: result];
|
||||
|
||||
// Allow pubs to pause auto-refresh immediately, by default.
|
||||
[result setExtraParameterForKey: @"allow_pause_auto_refresh_immediately" value: @"true"];
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -2015,25 +1829,6 @@ static ALUnityBackgroundCallback backgroundCallback;
|
||||
[MAUnityAdManager forwardUnityEventWithArgs: @{@"name" : @"OnSdkConsentDialogDismissedEvent"}];
|
||||
}
|
||||
|
||||
#pragma mark - Consent Flow
|
||||
|
||||
- (void)startConsentFlow
|
||||
{
|
||||
[self.sdk.cfService scfWithCompletionHander:^(ALCFError * _Nullable error) {
|
||||
|
||||
NSMutableDictionary<NSString *, id> *args = [NSMutableDictionary dictionaryWithCapacity: 3];
|
||||
args[@"name"] = @"OnSdkConsentFlowCompletedEvent";
|
||||
|
||||
if ( error )
|
||||
{
|
||||
args[@"code"] = @(error.code);
|
||||
args[@"message"] = error.message;
|
||||
}
|
||||
|
||||
[MAUnityAdManager forwardUnityEventWithArgs: args];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Variable Service (Deprecated)
|
||||
|
||||
- (void)loadVariables
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 2973e70bd2fa74984b35aea07ae9db52
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/AppLovin/Plugins/iOS/MAUnityAdManager.m
|
||||
- al_max_export_path-MaxSdk\AppLovin\Plugins\iOS\MAUnityAdManager.m
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@ -15,7 +16,7 @@ PluginImporter:
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
'': Any
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
|
||||
@ -37,20 +37,11 @@ extern "C"
|
||||
static NSNumber *_creativeDebuggerEnabledToSet;
|
||||
static NSNumber *_exceptionHandlerEnabledToSet;
|
||||
static NSNumber *_locationCollectionEnabledToSet;
|
||||
static NSNumber *_targetingYearOfBirth;
|
||||
static NSString *_targetingGender;
|
||||
static NSNumber *_targetingMaximumAdContentRating;
|
||||
static NSString *_targetingEmail;
|
||||
static NSString *_targetingPhoneNumber;
|
||||
static NSArray<NSString *> *_targetingKeywords;
|
||||
static NSArray<NSString *> *_targetingInterests;
|
||||
static NSMutableDictionary<NSString *, NSString *> *_extraParametersToSet = [NSMutableDictionary dictionary];
|
||||
static NSObject *_extraParametersToSetLock = [[NSObject alloc] init];
|
||||
|
||||
// Helper method to create C string copy
|
||||
static const char * cStringCopy(NSString *string);
|
||||
// Helper method to log errors
|
||||
void logUninitializedAccessError(char *callingMethod);
|
||||
|
||||
bool isPluginInitialized()
|
||||
{
|
||||
@ -76,42 +67,6 @@ extern "C"
|
||||
return array;
|
||||
}
|
||||
|
||||
ALGender getAppLovinGender(NSString *genderString)
|
||||
{
|
||||
if ( [@"F" al_isEqualToStringIgnoringCase: genderString] )
|
||||
{
|
||||
return ALGenderFemale;
|
||||
}
|
||||
else if ( [@"M" al_isEqualToStringIgnoringCase: genderString] )
|
||||
{
|
||||
return ALGenderMale;
|
||||
}
|
||||
else if ( [@"O" al_isEqualToStringIgnoringCase: genderString] )
|
||||
{
|
||||
return ALGenderOther;
|
||||
}
|
||||
|
||||
return ALGenderUnknown;
|
||||
}
|
||||
|
||||
ALAdContentRating getAppLovinAdContentRating(int maximumAdContentRating)
|
||||
{
|
||||
if ( maximumAdContentRating == 1 )
|
||||
{
|
||||
return ALAdContentRatingAllAudiences;
|
||||
}
|
||||
else if ( maximumAdContentRating == 2 )
|
||||
{
|
||||
return ALAdContentRatingEveryoneOverTwelve;
|
||||
}
|
||||
else if ( maximumAdContentRating == 3 )
|
||||
{
|
||||
return ALAdContentRatingMatureAudiences;
|
||||
}
|
||||
|
||||
return ALAdContentRatingNone;
|
||||
}
|
||||
|
||||
void setPendingExtraParametersIfNeeded(ALSdkSettings *settings)
|
||||
{
|
||||
NSDictionary *extraParameters;
|
||||
@ -174,7 +129,7 @@ extern "C"
|
||||
|
||||
if ( _verboseLoggingToSet )
|
||||
{
|
||||
_sdk.settings.verboseLoggingEnabled = _verboseLoggingToSet.boolValue;
|
||||
_sdk.settings.isVerboseLogging = _verboseLoggingToSet.boolValue;
|
||||
_verboseLoggingToSet = nil;
|
||||
}
|
||||
|
||||
@ -196,48 +151,6 @@ extern "C"
|
||||
_locationCollectionEnabledToSet = nil;
|
||||
}
|
||||
|
||||
if ( _targetingYearOfBirth )
|
||||
{
|
||||
_sdk.targetingData.yearOfBirth = _targetingYearOfBirth.intValue <= 0 ? nil : _targetingYearOfBirth;
|
||||
_targetingYearOfBirth = nil;
|
||||
}
|
||||
|
||||
if ( _targetingGender )
|
||||
{
|
||||
_sdk.targetingData.gender = getAppLovinGender(_targetingGender);
|
||||
_targetingGender = nil;
|
||||
}
|
||||
|
||||
if ( _targetingMaximumAdContentRating )
|
||||
{
|
||||
_sdk.targetingData.maximumAdContentRating = getAppLovinAdContentRating(_targetingMaximumAdContentRating.intValue);
|
||||
_targetingMaximumAdContentRating = nil;
|
||||
}
|
||||
|
||||
if ( _targetingEmail )
|
||||
{
|
||||
_sdk.targetingData.email = _targetingEmail;
|
||||
_targetingEmail = nil;
|
||||
}
|
||||
|
||||
if ( _targetingPhoneNumber )
|
||||
{
|
||||
_sdk.targetingData.phoneNumber = _targetingPhoneNumber;
|
||||
_targetingPhoneNumber = nil;
|
||||
}
|
||||
|
||||
if ( _targetingKeywords )
|
||||
{
|
||||
_sdk.targetingData.keywords = _targetingKeywords;
|
||||
_targetingKeywords = nil;
|
||||
}
|
||||
|
||||
if ( _targetingInterests )
|
||||
{
|
||||
_sdk.targetingData.interests = _targetingInterests;
|
||||
_targetingInterests = nil;
|
||||
}
|
||||
|
||||
setPendingExtraParametersIfNeeded( _sdk.settings );
|
||||
}
|
||||
|
||||
@ -282,17 +195,6 @@ extern "C"
|
||||
[_sdk showMediationDebugger];
|
||||
}
|
||||
|
||||
void _MaxShowCreativeDebugger()
|
||||
{
|
||||
if ( !_sdk )
|
||||
{
|
||||
NSLog(@"[%@] Failed to show creative debugger - please ensure the AppLovin MAX Unity Plugin has been initialized by calling 'MaxSdk.InitializeSdk();'!", TAG);
|
||||
return;
|
||||
}
|
||||
|
||||
[_sdk showCreativeDebugger];
|
||||
}
|
||||
|
||||
void _MaxShowConsentDialog()
|
||||
{
|
||||
NSLog(@"[%@] Failed to show consent dialog - Unavailable on iOS, please use the consent flow: https://dash.applovin.com/documentation/mediation/unity/getting-started/consent-flow", TAG);
|
||||
@ -334,98 +236,82 @@ extern "C"
|
||||
|
||||
void _MaxSetTargetingDataYearOfBirth(const int yearOfBirth)
|
||||
{
|
||||
if ( !_sdk )
|
||||
{
|
||||
_targetingYearOfBirth = @(yearOfBirth);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !isPluginInitialized() ) return;
|
||||
_sdk.targetingData.yearOfBirth = yearOfBirth <= 0 ? nil : @(yearOfBirth);
|
||||
}
|
||||
|
||||
void _MaxSetTargetingDataGender(char *gender)
|
||||
void _MaxSetTargetingDataGender(const char *gender)
|
||||
{
|
||||
if ( !_sdk )
|
||||
{
|
||||
_targetingGender = NSSTRING(gender);
|
||||
return;
|
||||
}
|
||||
if ( !isPluginInitialized() ) return;
|
||||
|
||||
NSString *genderString = NSSTRING(gender);
|
||||
_sdk.targetingData.gender = getAppLovinGender(genderString);
|
||||
ALGender alGender = ALGenderUnknown;
|
||||
|
||||
if ( [genderString isEqualToString: @"F"] )
|
||||
{
|
||||
alGender = ALGenderFemale;
|
||||
}
|
||||
else if ( [genderString isEqualToString: @"M"] )
|
||||
{
|
||||
alGender = ALGenderMale;
|
||||
}
|
||||
else if ( [genderString isEqualToString: @"O"] )
|
||||
{
|
||||
alGender = ALGenderOther;
|
||||
}
|
||||
|
||||
_sdk.targetingData.gender = alGender;
|
||||
}
|
||||
|
||||
void _MaxSetTargetingDataMaximumAdContentRating(const int maximumAdContentRating)
|
||||
{
|
||||
if ( !_sdk )
|
||||
if ( !isPluginInitialized() ) return;
|
||||
|
||||
ALAdContentRating rating = ALAdContentRatingNone;
|
||||
|
||||
if ( maximumAdContentRating == 1 )
|
||||
{
|
||||
_targetingMaximumAdContentRating = @(maximumAdContentRating);
|
||||
return;
|
||||
rating = ALAdContentRatingAllAudiences;
|
||||
}
|
||||
else if ( maximumAdContentRating == 2 )
|
||||
{
|
||||
rating = ALAdContentRatingEveryoneOverTwelve;
|
||||
}
|
||||
else if ( maximumAdContentRating == 3 )
|
||||
{
|
||||
rating = ALAdContentRatingMatureAudiences;
|
||||
}
|
||||
|
||||
_sdk.targetingData.maximumAdContentRating = getAppLovinAdContentRating(maximumAdContentRating);
|
||||
_sdk.targetingData.maximumAdContentRating = rating;
|
||||
}
|
||||
|
||||
void _MaxSetTargetingDataEmail(char *email)
|
||||
void _MaxSetTargetingDataEmail(const char *email)
|
||||
{
|
||||
if ( !_sdk )
|
||||
{
|
||||
_targetingEmail = NSSTRING(email);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !isPluginInitialized() ) return;
|
||||
_sdk.targetingData.email = NSSTRING(email);
|
||||
}
|
||||
|
||||
void _MaxSetTargetingDataPhoneNumber(char *phoneNumber)
|
||||
void _MaxSetTargetingDataPhoneNumber(const char *phoneNumber)
|
||||
{
|
||||
if ( !_sdk )
|
||||
{
|
||||
_targetingPhoneNumber = NSSTRING(phoneNumber);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !isPluginInitialized() ) return;
|
||||
_sdk.targetingData.phoneNumber = NSSTRING(phoneNumber);
|
||||
}
|
||||
|
||||
void _MaxSetTargetingDataKeywords(char **keywords, int size)
|
||||
{
|
||||
NSArray<NSString *> *keywordsArray = keywords ? toStringArray(keywords, size) : nil;
|
||||
if ( !_sdk )
|
||||
{
|
||||
_targetingKeywords = keywordsArray;
|
||||
return;
|
||||
}
|
||||
|
||||
_sdk.targetingData.keywords = keywordsArray;
|
||||
if ( !isPluginInitialized() ) return;
|
||||
_sdk.targetingData.keywords = toStringArray(keywords, size);
|
||||
}
|
||||
|
||||
void _MaxSetTargetingDataInterests(char **interests, int size)
|
||||
{
|
||||
NSArray<NSString *> *interestsArray = interests ? toStringArray(interests, size) : nil;
|
||||
if ( !_sdk )
|
||||
{
|
||||
_targetingInterests = interestsArray;
|
||||
return;
|
||||
}
|
||||
|
||||
_sdk.targetingData.interests = interestsArray;
|
||||
if ( !isPluginInitialized() ) return;
|
||||
_sdk.targetingData.interests = toStringArray(interests, size);
|
||||
}
|
||||
|
||||
void _MaxClearAllTargetingData()
|
||||
{
|
||||
if ( !_sdk )
|
||||
{
|
||||
_targetingYearOfBirth = nil;
|
||||
_targetingGender = nil;
|
||||
_targetingMaximumAdContentRating = nil;
|
||||
_targetingEmail = nil;
|
||||
_targetingPhoneNumber = nil;
|
||||
_targetingKeywords = nil;
|
||||
_targetingInterests = nil;
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !isPluginInitialized() ) return;
|
||||
[_sdk.targetingData clearAll];
|
||||
}
|
||||
|
||||
@ -433,7 +319,7 @@ extern "C"
|
||||
{
|
||||
if ( !_sdk )
|
||||
{
|
||||
logUninitializedAccessError("_MaxGetSdkConfiguration");
|
||||
NSLog(@"[%@] Failed to get SDK configuration - please ensure the AppLovin MAX Unity Plugin has been initialized by calling 'MaxSdk.InitializeSdk();'!", TAG);
|
||||
return cStringCopy(@"");
|
||||
}
|
||||
|
||||
@ -443,8 +329,7 @@ extern "C"
|
||||
return cStringCopy([MAUnityAdManager serializeParameters: @{@"consentDialogState" : consentDialogStateStr,
|
||||
@"countryCode" : _sdk.configuration.countryCode,
|
||||
@"appTrackingStatus" : appTrackingStatus,
|
||||
@"isSuccessfullyInitialized" : @([_sdk isInitialized]),
|
||||
@"isTestModeEnabled" : @([_sdk.configuration isTestModeEnabled])}]);
|
||||
@"isSuccessfullyInitialized" : ([_sdk isInitialized] ? @"true" : @"false")}]);
|
||||
}
|
||||
|
||||
void _MaxSetHasUserConsent(bool hasUserConsent)
|
||||
@ -506,13 +391,6 @@ extern "C"
|
||||
[_adManager createBannerWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) x: x y: y];
|
||||
}
|
||||
|
||||
void _MaxLoadBanner(const char *adUnitIdentifier)
|
||||
{
|
||||
if (!isPluginInitialized()) return;
|
||||
|
||||
[_adManager loadBannerWithAdUnitIdentifier: NSSTRING(adUnitIdentifier)];
|
||||
}
|
||||
|
||||
void _MaxSetBannerBackgroundColor(const char *adUnitIdentifier, const char *hexColorCode)
|
||||
{
|
||||
if (!isPluginInitialized()) return;
|
||||
@ -615,13 +493,6 @@ extern "C"
|
||||
[_adManager createMRecWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) x: x y: y];
|
||||
}
|
||||
|
||||
void _MaxLoadMRec(const char *adUnitIdentifier)
|
||||
{
|
||||
if (!isPluginInitialized()) return;
|
||||
|
||||
[_adManager loadMRecWithAdUnitIdentifier: NSSTRING(adUnitIdentifier)];
|
||||
}
|
||||
|
||||
void _MaxSetMRecPlacement(const char *adUnitIdentifier, const char *placement)
|
||||
{
|
||||
[_adManager setMRecPlacement: NSSTRING(placement) forAdUnitIdentifier: NSSTRING(adUnitIdentifier)];
|
||||
@ -778,41 +649,6 @@ extern "C"
|
||||
[_adManager showInterstitialWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) placement: NSSTRING(placement) customData: NSSTRING(customData)];
|
||||
}
|
||||
|
||||
void _MaxLoadAppOpenAd(const char *adUnitIdentifier)
|
||||
{
|
||||
if (!isPluginInitialized()) return;
|
||||
|
||||
[_adManager loadAppOpenAdWithAdUnitIdentifier: NSSTRING(adUnitIdentifier)];
|
||||
}
|
||||
|
||||
void _MaxSetAppOpenAdExtraParameter(const char *adUnitIdentifier, const char *key, const char *value)
|
||||
{
|
||||
[_adManager setAppOpenAdExtraParameterForAdUnitIdentifier: NSSTRING(adUnitIdentifier)
|
||||
key: NSSTRING(key)
|
||||
value: NSSTRING(value)];
|
||||
}
|
||||
|
||||
void _MaxSetAppOpenAdLocalExtraParameter(const char *adUnitIdentifier, const char *key, MAUnityRef value)
|
||||
{
|
||||
[_adManager setAppOpenAdLocalExtraParameterForAdUnitIdentifier: NSSTRING(adUnitIdentifier)
|
||||
key: NSSTRING(key)
|
||||
value: (__bridge id)value];
|
||||
}
|
||||
|
||||
bool _MaxIsAppOpenAdReady(const char *adUnitIdentifier)
|
||||
{
|
||||
if (!isPluginInitialized()) return false;
|
||||
|
||||
return [_adManager isAppOpenAdReadyWithAdUnitIdentifier: NSSTRING(adUnitIdentifier)];
|
||||
}
|
||||
|
||||
void _MaxShowAppOpenAd(const char *adUnitIdentifier, const char *placement, const char *customData)
|
||||
{
|
||||
if (!isPluginInitialized()) return;
|
||||
|
||||
[_adManager showAppOpenAdWithAdUnitIdentifier: NSSTRING(adUnitIdentifier) placement: NSSTRING(placement) customData: NSSTRING(customData)];
|
||||
}
|
||||
|
||||
void _MaxLoadRewardedAd(const char *adUnitIdentifier)
|
||||
{
|
||||
if (!isPluginInitialized()) return;
|
||||
@ -953,7 +789,7 @@ extern "C"
|
||||
{
|
||||
if ( _sdk )
|
||||
{
|
||||
_sdk.settings.verboseLoggingEnabled = enabled;
|
||||
_sdk.settings.isVerboseLogging = enabled;
|
||||
_verboseLoggingToSet = nil;
|
||||
}
|
||||
else
|
||||
@ -966,7 +802,7 @@ extern "C"
|
||||
{
|
||||
if ( _sdk )
|
||||
{
|
||||
return [_sdk.settings isVerboseLoggingEnabled];
|
||||
return _sdk.settings.isVerboseLogging;
|
||||
}
|
||||
else if ( _verboseLoggingToSet )
|
||||
{
|
||||
@ -1054,38 +890,11 @@ extern "C"
|
||||
}
|
||||
}
|
||||
|
||||
const char * _MaxGetCFType()
|
||||
{
|
||||
if ( !_sdk )
|
||||
{
|
||||
NSLog(@"[%@] Failed to get available mediated networks - please ensure the AppLovin MAX Unity Plugin has been initialized by calling 'MaxSdk.InitializeSdk();'!", TAG);
|
||||
return cStringCopy(@(ALCFTypeUnknown).stringValue);
|
||||
}
|
||||
|
||||
return cStringCopy(@(_sdk.cfService.cfType).stringValue);
|
||||
}
|
||||
|
||||
void _MaxStartConsentFlow()
|
||||
{
|
||||
if (!isPluginInitialized())
|
||||
{
|
||||
logUninitializedAccessError("_MaxStartConsentFlow");
|
||||
return;
|
||||
}
|
||||
|
||||
[_adManager startConsentFlow];
|
||||
}
|
||||
|
||||
float _MaxGetAdaptiveBannerHeight(const float width)
|
||||
{
|
||||
return [MAUnityAdManager adaptiveBannerHeightForWidth: width];
|
||||
}
|
||||
|
||||
void logUninitializedAccessError(char *callingMethod)
|
||||
{
|
||||
NSLog(@"[%@] Failed to execute: %s - please ensure the AppLovin MAX Unity Plugin has been initialized by calling 'MaxSdk.InitializeSdk();'!", TAG, callingMethod);
|
||||
}
|
||||
|
||||
[[deprecated("This API has been deprecated. Please use our SDK's initialization callback to retrieve variables instead.")]]
|
||||
void _MaxLoadVariables()
|
||||
{
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 7e373ed7168b243e6b706e991ab5a643
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/AppLovin/Plugins/iOS/MAUnityPlugin.mm
|
||||
- al_max_export_path-MaxSdk\AppLovin\Plugins\iOS\MAUnityPlugin.mm
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@ -15,7 +16,7 @@ PluginImporter:
|
||||
validateReferences: 1
|
||||
platformData:
|
||||
- first:
|
||||
'': Any
|
||||
: Any
|
||||
second:
|
||||
enabled: 0
|
||||
settings:
|
||||
|
||||
1
Assets/ThirdParty/MaxSdk/Mediation.meta
vendored
1
Assets/ThirdParty/MaxSdk/Mediation.meta
vendored
@ -3,6 +3,7 @@ guid: dcf2020c4018447c9b91170c0f62d799
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation
|
||||
- al_max_export_path-MaxSdk\Mediation
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<!-- <androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:adcolony-adapter:4.8.0.4"/>
|
||||
<androidPackage spec="com.applovin.mediation:adcolony-adapter:4.8.0.2"/>
|
||||
</androidPackages> -->
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationAdColonyAdapter" version="4.9.0.0.4"/>
|
||||
<iosPod name="AppLovinMediationAdColonyAdapter" version="4.9.0.0.2"/>
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -3,6 +3,7 @@ guid: a351b114cfc11494ba8c131833b1bf74
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/AdColony/Editor/Dependencies.xml
|
||||
- al_max_export_path-MaxSdk\Mediation\AdColony\Editor\Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -3,6 +3,7 @@ guid: ef8467ffb0e4447b79a8804884a7520a
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/ByteDance/Editor
|
||||
- al_max_export_path-MaxSdk\Mediation\ByteDance\Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<!-- <androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:bytedance-adapter:5.4.1.0.0">
|
||||
<androidPackage spec="com.applovin.mediation:bytedance-adapter:4.5.0.6.0">
|
||||
<repositories>
|
||||
<repository>https://artifact.bytedance.com/repository/pangle</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages> -->
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationByteDanceAdapter" version="5.4.1.0.0" />
|
||||
<iosPod name="AppLovinMediationByteDanceAdapter" version="4.6.1.3.0" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 0828555cb1ce94702a4af6f3dce3d735
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/ByteDance/Editor/Dependencies.xml
|
||||
- al_max_export_path-MaxSdk\Mediation\ByteDance\Editor\Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -3,6 +3,7 @@ guid: a90f13141c35746f5a2996c8ad068fe9
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Chartboost/Editor
|
||||
- al_max_export_path-MaxSdk\Mediation\Chartboost\Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<!-- <androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:chartboost-adapter:9.4.1.0">
|
||||
<repositories>
|
||||
<repository>https://cboost.jfrog.io/artifactory/chartboost-ads/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
<androidPackage spec="com.applovin.mediation:chartboost-adapter:8.4.3.1" />
|
||||
<androidPackage spec="com.google.android.gms:play-services-base:16.1.0" />
|
||||
</androidPackages> -->
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationChartboostAdapter" version="9.4.0.0" />
|
||||
<iosPod name="AppLovinMediationChartboostAdapter" version="9.0.0.0" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 93b0a4618bd884871af0981a7867bb2f
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Chartboost/Editor/Dependencies.xml
|
||||
- al_max_export_path-MaxSdk\Mediation\Chartboost\Editor\Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 28880992a399a48b7abe95b66649d711
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Facebook/Editor
|
||||
- al_max_export_path-MaxSdk\Mediation\Facebook\Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -5,9 +5,9 @@
|
||||
Since FAN SDK depends on older versions of a few support and play service versions
|
||||
`com.applovin.mediation:facebook-adapter:x.y.z.a` resolves to `com.applovin.mediation:facebook-adapter:+` which pulls down the beta versions of FAN SDK.
|
||||
Note that forcing the adapter is enough to stop Jar Resolver from pulling the latest FAN SDK. -->
|
||||
<!-- <androidPackage spec="com.applovin.mediation:facebook-adapter:[6.15.0.0]" /> -->
|
||||
<!-- <androidPackage spec="com.applovin.mediation:facebook-adapter:[6.11.0.5]" /> -->
|
||||
<!-- </androidPackages> -->
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationFacebookAdapter" version="6.14.0.0" />
|
||||
<iosPod name="AppLovinMediationFacebookAdapter" version="6.11.2.1" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -3,6 +3,7 @@ guid: aea9bdf974328420db5ae118ef0d2b87
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Facebook/Editor/Dependencies.xml
|
||||
- al_max_export_path-MaxSdk\Mediation\Facebook\Editor\Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -3,6 +3,7 @@ guid: e076e4ef7e2874ba69b108cc7a346c2a
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Fyber/Editor
|
||||
- al_max_export_path-MaxSdk\Mediation\Fyber\Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<!-- <androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:fyber-adapter:8.2.3.3"/>
|
||||
<androidPackage spec="com.applovin.mediation:fyber-adapter:8.2.0.0"/>
|
||||
</androidPackages> -->
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationFyberAdapter" version="8.2.4.0"/>
|
||||
<iosPod name="AppLovinMediationFyberAdapter" version="8.1.6.0"/>
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 5e123cdc08e804dffb2c40c4fbc83caf
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Fyber/Editor/Dependencies.xml
|
||||
- al_max_export_path-MaxSdk\Mediation\Fyber\Editor\Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -3,6 +3,7 @@ guid: e8015bd045cea462c8f39c8a05867d08
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Google/Editor
|
||||
- al_max_export_path-MaxSdk\Mediation\Google\Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -2,9 +2,9 @@
|
||||
<dependencies>
|
||||
<!-- <androidPackages> -->
|
||||
<!-- Ensure that Resolver doesn't inadvertently pull the latest Play Services Ads' SDK that we haven't certified against. -->
|
||||
<!-- <androidPackage spec="com.applovin.mediation:google-adapter:[22.3.0.0]" />
|
||||
<!-- <androidPackage spec="com.applovin.mediation:google-adapter:[21.1.0.0]" />
|
||||
</androidPackages> -->
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationGoogleAdapter" version="10.10.0.0" />
|
||||
<iosPod name="AppLovinMediationGoogleAdapter" version="9.8.0.0" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 053b810d3594744e38b6fd0fa378fb57
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Google/Editor/Dependencies.xml
|
||||
- al_max_export_path-MaxSdk\Mediation\Google\Editor\Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
38
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/MaxGoogleInitialize.cs
vendored
Normal file
38
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/MaxGoogleInitialize.cs
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
//
|
||||
// MaxGoogleInitialize.cs
|
||||
// AppLovin MAX Unity Plugin
|
||||
//
|
||||
// Created by Santosh Bagadi on 10/5/20.
|
||||
// Copyright © 2020 AppLovin. All rights reserved.
|
||||
//
|
||||
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AppLovinMax.Mediation.Google.Editor
|
||||
{
|
||||
[InitializeOnLoad]
|
||||
public class MaxGoogleInitialize
|
||||
{
|
||||
private static readonly string LegacyMaxMediationGoogleDir = Path.Combine("Assets", "Plugins/Android/MaxMediationGoogle");
|
||||
|
||||
static MaxGoogleInitialize()
|
||||
{
|
||||
// 安卓不处理
|
||||
if (true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Check if the MaxMediationGoogle directory exists and append .androidlib to it.
|
||||
if (Directory.Exists(LegacyMaxMediationGoogleDir))
|
||||
{
|
||||
Debug.Log("[AppLovin MAX] Updating Google Android library directory name to make it compatible with Unity 2020+ versions.");
|
||||
|
||||
FileUtil.MoveFileOrDirectory(LegacyMaxMediationGoogleDir, LegacyMaxMediationGoogleDir + ".androidlib");
|
||||
FileUtil.MoveFileOrDirectory(LegacyMaxMediationGoogleDir + ".meta", LegacyMaxMediationGoogleDir + ".androidlib" + ".meta");
|
||||
AssetDatabase.Refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/MaxGoogleInitialize.cs.meta
vendored
Normal file
15
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/MaxGoogleInitialize.cs.meta
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2376824a26af1414bbc62440698ccc89
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Google/Editor/MaxGoogleInitialize.cs
|
||||
- al_max_export_path-MaxSdk\Mediation\Google\Editor\MaxGoogleInitialize.cs
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
59
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/MaxMediationGoogleUtils.cs
vendored
Normal file
59
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/MaxMediationGoogleUtils.cs
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
//
|
||||
// MaxMediationGoogleUtils.cs
|
||||
// AppLovin MAX Unity Plugin
|
||||
//
|
||||
// Created by Santosh Bagadi on 11/7/19.
|
||||
// Copyright © 2019 AppLovin. All rights reserved.
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AppLovinMax.Mediation.Google.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// An Utils class containing shared convenience methods.
|
||||
/// </summary>
|
||||
public static class MaxMediationGoogleUtils
|
||||
{
|
||||
private const string AppLovinSettingsExportPath = "MaxSdk/Resources/AppLovinSettings.asset";
|
||||
|
||||
/// <summary>
|
||||
/// Loads the AppLovin Settings asset if it is available and returns the value for the given property name.
|
||||
/// </summary>
|
||||
/// <param name="property">The name of the property for which to get the value of from <c>AppLovinSettings.asset</c> file.</param>
|
||||
/// <returns>The string value of the property if found.</returns>
|
||||
public static string GetAppIdFromAppLovinSettings(string property)
|
||||
{
|
||||
var settingsFileName = GetAppLovinSettingsAssetPath();
|
||||
if (!File.Exists(settingsFileName))
|
||||
{
|
||||
Debug.LogError("[AppLovin MAX] The current plugin version is incompatible with the AdMob adapter. Please update the AppLovin MAX plugin to version 2.4.0 or higher.");
|
||||
return null;
|
||||
}
|
||||
|
||||
var instance = AssetDatabase.LoadAssetAtPath(settingsFileName, Type.GetType("AppLovinSettings, MaxSdk.Scripts.IntegrationManager.Editor"));
|
||||
if (instance == null)
|
||||
{
|
||||
Debug.LogError("[AppLovin MAX] The current plugin version is incompatible with the AdMob adapter. Please update the AppLovin MAX plugin to version 2.4.15 or higher");
|
||||
return null;
|
||||
}
|
||||
|
||||
var adMobAppIdProperty = instance.GetType().GetProperty(property);
|
||||
return adMobAppIdProperty == null ? null : adMobAppIdProperty.GetValue(instance, null).ToString();
|
||||
}
|
||||
|
||||
private static string GetAppLovinSettingsAssetPath()
|
||||
{
|
||||
// Since the settings asset is generated during compile time, the asset label will contain platform specific path separator. So, use platform specific export path.
|
||||
var assetLabel = "l:al_max_export_path-" + AppLovinSettingsExportPath.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
|
||||
var guids = AssetDatabase.FindAssets(assetLabel);
|
||||
|
||||
var defaultPath = Path.Combine("Assets", AppLovinSettingsExportPath);
|
||||
|
||||
return guids.Length > 0 ? AssetDatabase.GUIDToAssetPath(guids[0]) : defaultPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/MaxMediationGoogleUtils.cs.meta
vendored
Normal file
15
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/MaxMediationGoogleUtils.cs.meta
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6de4e4d420b14431a7d169724e23361e
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Google/Editor/MaxMediationGoogleUtils.cs
|
||||
- al_max_export_path-MaxSdk\Mediation\Google\Editor\MaxMediationGoogleUtils.cs
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
48
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/PostProcessor.cs
vendored
Normal file
48
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/PostProcessor.cs
vendored
Normal file
@ -0,0 +1,48 @@
|
||||
//
|
||||
// PostProcessor.cs
|
||||
// AppLovin MAX Unity Plugin
|
||||
//
|
||||
// Created by Santosh Bagadi on 6/4/19.
|
||||
// Copyright © 2019 AppLovin. All rights reserved.
|
||||
//
|
||||
|
||||
#if UNITY_IPHONE || UNITY_IOS
|
||||
|
||||
using System.IO;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Callbacks;
|
||||
using UnityEditor.iOS.Xcode;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AppLovinMax.Mediation.Google.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// A post processor that will add the AdMob App ID to the <c>info.plist</c> file.
|
||||
/// </summary>
|
||||
public class PostProcessor
|
||||
{
|
||||
[PostProcessBuild]
|
||||
public static void OnPostProcessBuild(BuildTarget buildTarget, string buildPath)
|
||||
{
|
||||
var appId = MaxMediationGoogleUtils.GetAppIdFromAppLovinSettings("AdMobIosAppId");
|
||||
|
||||
// Log error if the App ID is not set.
|
||||
if (string.IsNullOrEmpty(appId) || !appId.StartsWith("ca-app-pub-"))
|
||||
{
|
||||
Debug.LogError("[AppLovin MAX] AdMob App ID is not set. Please enter a valid app ID within the AppLovin Integration Manager window.");
|
||||
return;
|
||||
}
|
||||
|
||||
var plistPath = Path.Combine(buildPath, "Info.plist");
|
||||
var plist = new PlistDocument();
|
||||
plist.ReadFromFile(plistPath);
|
||||
|
||||
// Actually set (then write) AdMob app id to Info.plist if valid
|
||||
plist.root.SetString("GADApplicationIdentifier", appId);
|
||||
|
||||
File.WriteAllText(plistPath, plist.WriteToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -1,8 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0acf281ba86b4929a6942ecd998395b
|
||||
guid: 42aa959278164e1683addd3bd5ff03d2
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Scripts/MaxEventSystemChecker.cs
|
||||
- al_max_export_path-MaxSdk/Mediation/Google/Editor/PostProcessor.cs
|
||||
- al_max_export_path-MaxSdk\Mediation\Google\Editor\PostProcessor.cs
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
115
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/PreProcessor.cs
vendored
Normal file
115
Assets/ThirdParty/MaxSdk/Mediation/Google/Editor/PreProcessor.cs
vendored
Normal file
@ -0,0 +1,115 @@
|
||||
//
|
||||
// PreProcessor.cs
|
||||
// AppLovin MAX Unity Plugin
|
||||
//
|
||||
// Created by Santosh Bagadi on 11/7/19.
|
||||
// Copyright © 2019 AppLovin. All rights reserved.
|
||||
//
|
||||
|
||||
#if UNITY_ANDROID
|
||||
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
using UnityEditor.Build.Reporting;
|
||||
#endif
|
||||
using UnityEngine;
|
||||
|
||||
namespace AppLovinMax.Mediation.Google.Editor
|
||||
{
|
||||
/// <summary>
|
||||
/// A pre processor that will add the AdMob App ID to the <c>AndroidManifest.xml</c> file.
|
||||
/// </summary>
|
||||
public class PreProcessor :
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
IPreprocessBuildWithReport
|
||||
#else
|
||||
IPreprocessBuild
|
||||
#endif
|
||||
{
|
||||
#if UNITY_2018_1_OR_NEWER
|
||||
public void OnPreprocessBuild(BuildReport report)
|
||||
#else
|
||||
public void OnPreprocessBuild(BuildTarget target, string path)
|
||||
#endif
|
||||
{
|
||||
// 安卓先不处理
|
||||
if (true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
var appId = MaxMediationGoogleUtils.GetAppIdFromAppLovinSettings("AdMobAndroidAppId");
|
||||
if (string.IsNullOrEmpty(appId))
|
||||
{
|
||||
Debug.LogError("[AppLovin MAX] AdMob App ID is not set. Please enter a valid app ID within the ");
|
||||
return;
|
||||
}
|
||||
|
||||
var manifestPath = Path.Combine(Application.dataPath, "Plugins/Android/MaxMediationGoogle.androidlib/AndroidManifest.xml");
|
||||
|
||||
XDocument manifest;
|
||||
try
|
||||
{
|
||||
manifest = XDocument.Load(manifestPath);
|
||||
}
|
||||
#pragma warning disable 0168
|
||||
catch (IOException exception)
|
||||
#pragma warning restore 0168
|
||||
{
|
||||
Debug.LogError("[AppLovin MAX] Google mediation AndroidManifest.xml is missing. Ensure that MAX Google mediation plugin is imported correctly.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the `manifest` element.
|
||||
var elementManifest = manifest.Element("manifest");
|
||||
if (elementManifest == null)
|
||||
{
|
||||
Debug.LogError("[AppLovin MAX] Google mediation AndroidManifest.xml is invalid. Ensure that MAX Google mediation plugin is imported correctly.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get the `application` element under `manifest`.
|
||||
var elementApplication = elementManifest.Element("application");
|
||||
if (elementApplication == null)
|
||||
{
|
||||
Debug.LogError("[AppLovin MAX] Google mediation AndroidManifest.xml is invalid. Ensure that MAX Google mediation plugin is imported correctly.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Get all the `meta-data` elements under `application`.
|
||||
var adMobMetaData = elementApplication.Descendants().First(element => element.Name.LocalName.Equals("meta-data"));
|
||||
XNamespace androidNamespace = "http://schemas.android.com/apk/res/android";
|
||||
|
||||
if (!adMobMetaData.FirstAttribute.Name.Namespace.Equals(androidNamespace) ||
|
||||
!adMobMetaData.FirstAttribute.Name.LocalName.Equals("name") ||
|
||||
!adMobMetaData.FirstAttribute.Value.Equals("com.google.android.gms.ads.APPLICATION_ID"))
|
||||
{
|
||||
Debug.LogError("[AppLovin MAX] Google mediation AndroidManifest.xml is invalid. Ensure that MAX Google mediation plugin is imported correctly.");
|
||||
return;
|
||||
}
|
||||
|
||||
var lastAttribute = adMobMetaData.LastAttribute;
|
||||
// Log error if the AdMob App ID is not set.
|
||||
if (!lastAttribute.Name.LocalName.Equals("value"))
|
||||
{
|
||||
Debug.LogError("[AppLovin MAX] Google mediation AndroidManifest.xml is invalid. Ensure that MAX Google mediation plugin is imported correctly.");
|
||||
}
|
||||
|
||||
// Set the App ID value.
|
||||
lastAttribute.Value = appId;
|
||||
|
||||
// Save the updated manifest file.
|
||||
manifest.Save(manifestPath);
|
||||
}
|
||||
|
||||
public int callbackOrder
|
||||
{
|
||||
get { return 0; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -1,8 +1,9 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65c51e21887ae42c2839962fb9585e9f
|
||||
guid: bfbc947903224d09a77085f74b86a409
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Scripts/IntegrationManager/Editor/AppLovinInternalSettings.cs
|
||||
- al_max_export_path-MaxSdk/Mediation/Google/Editor/PreProcessor.cs
|
||||
- al_max_export_path-MaxSdk\Mediation\Google\Editor\PreProcessor.cs
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@ -3,6 +3,7 @@ guid: a141703acd55a48c2a3e6e6599f90c64
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/InMobi/Editor
|
||||
- al_max_export_path-MaxSdk\Mediation\InMobi\Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<!-- <androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:inmobi-adapter:10.1.4.3" />
|
||||
<androidPackage spec="com.applovin.mediation:inmobi-adapter:10.0.8.1" />
|
||||
<androidPackage spec="com.squareup.picasso:picasso:2.71828" />
|
||||
<androidPackage spec="com.android.support:recyclerview-v7:28.+" />
|
||||
<androidPackage spec="com.android.support:customtabs:28.+" />
|
||||
</androidPackages> -->
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationInMobiAdapter" version="10.5.6.0" />
|
||||
<iosPod name="AppLovinMediationInMobiAdapter" version="10.0.8.1" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -3,6 +3,7 @@ guid: bc66a0ef4503843ee9b1bf1b1e867367
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/InMobi/Editor/Dependencies.xml
|
||||
- al_max_export_path-MaxSdk\Mediation\InMobi\Editor\Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 531d860cac61f47d19e32f526470ae43
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/IronSource/Editor
|
||||
- al_max_export_path-MaxSdk\Mediation\IronSource\Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<!-- <androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:ironsource-adapter:7.5.0.0.1">
|
||||
<androidPackage spec="com.applovin.mediation:ironsource-adapter:7.2.3.1.0">
|
||||
<repositories>
|
||||
<repository>https://android-sdk.is.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages> -->
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationIronSourceAdapter" version="7.5.0.0.0" />
|
||||
<iosPod name="AppLovinMediationIronSourceAdapter" version="7.2.3.1.0" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 19262406303f04f05b14b31b3c734d35
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/IronSource/Editor/Dependencies.xml
|
||||
- al_max_export_path-MaxSdk\Mediation\IronSource\Editor\Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -3,6 +3,7 @@ guid: db1de4066dc4e4290b3879b34fa87de2
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Mintegral/Editor
|
||||
- al_max_export_path-MaxSdk\Mediation\Mintegral\Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<!-- <androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:mintegral-adapter:16.5.11.0">
|
||||
<androidPackage spec="com.applovin.mediation:mintegral-adapter:16.2.11.0">
|
||||
<repositories>
|
||||
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea</repository>
|
||||
</repositories>
|
||||
@ -9,6 +9,6 @@
|
||||
<androidPackage spec="androidx.recyclerview:recyclerview:1.2.1" />
|
||||
</androidPackages> -->
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationMintegralAdapter" version="7.4.3.0.0" />
|
||||
<iosPod name="AppLovinMediationMintegralAdapter" version="7.1.9.0.0" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 221b2a20a58a04f2cb4afb0779587206
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml
|
||||
- al_max_export_path-MaxSdk\Mediation\Mintegral\Editor\Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 6b21a711d751f4e1d9c77b5fb984e112
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Tapjoy/Editor
|
||||
- al_max_export_path-MaxSdk\Mediation\Tapjoy\Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<!-- <androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:tapjoy-adapter:13.1.2.0">
|
||||
<androidPackage spec="com.applovin.mediation:tapjoy-adapter:12.10.0.2">
|
||||
<repositories>
|
||||
<repository>https://sdk.tapjoy.com/</repository>
|
||||
</repositories>
|
||||
</androidPackage>
|
||||
</androidPackages> -->
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationTapjoyAdapter" version="13.1.2.0" />
|
||||
<iosPod name="AppLovinMediationTapjoyAdapter" version="12.10.0.1" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
@ -3,6 +3,7 @@ guid: c5268a136291a461aad1c0175bccb266
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/Tapjoy/Editor/Dependencies.xml
|
||||
- al_max_export_path-MaxSdk\Mediation\Tapjoy\Editor\Dependencies.xml
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -3,6 +3,7 @@ guid: 30751f2dc322a40e588edfb7c978c9c0
|
||||
labels:
|
||||
- al_max
|
||||
- al_max_export_path-MaxSdk/Mediation/UnityAds/Editor
|
||||
- al_max_export_path-MaxSdk\Mediation\UnityAds\Editor
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<dependencies>
|
||||
<!-- <androidPackages>
|
||||
<androidPackage spec="com.applovin.mediation:unityads-adapter:4.8.0.0" />
|
||||
<androidPackage spec="com.applovin.mediation:unityads-adapter:4.3.0.0" />
|
||||
</androidPackages> -->
|
||||
<iosPods>
|
||||
<iosPod name="AppLovinMediationUnityAdsAdapter" version="4.8.0.1" />
|
||||
<iosPod name="AppLovinMediationUnityAdsAdapter" version="4.3.0.0" />
|
||||
</iosPods>
|
||||
</dependencies>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user