Skip to content

Commit

Permalink
chore: update plugin to 1.0.1-beta07
Browse files Browse the repository at this point in the history
  • Loading branch information
MortezaNedaei committed Jul 6, 2024
1 parent 0407e5d commit 36c71d0
Show file tree
Hide file tree
Showing 43 changed files with 150 additions and 47 deletions.
Binary file modified Assets/GoogleMobileAds/GoogleMobileAds.Android.dll
Binary file not shown.
Binary file modified Assets/GoogleMobileAds/GoogleMobileAds.Common.dll
Binary file not shown.
Binary file modified Assets/GoogleMobileAds/GoogleMobileAds.Core.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Assets/GoogleMobileAds/GoogleMobileAds.Ump.dll
Binary file not shown.
Binary file modified Assets/GoogleMobileAds/GoogleMobileAds.Unity.dll
Binary file not shown.
Binary file modified Assets/GoogleMobileAds/GoogleMobileAds.dll
Binary file not shown.
4 changes: 4 additions & 0 deletions Assets/GoogleMobileAds/link.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
<namespace fullname="GoogleMobileAds" preserve="all" />
<namespace fullname="GoogleMobileAds.Android" preserve="all" />
</assembly>
<assembly fullname="GoogleMobileAds.Ump.Android" ignoreIfMissing="1">
<namespace fullname="GoogleMobileAds" preserve="all" />
<namespace fullname="GoogleMobileAds.Ump.Android" preserve="all" />
</assembly>
</linker>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ir.tapsell.mediation.adapter.admob">
<application>
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-6201798499291567~9611758993" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ir.tapsell.mediation.adapter.applovin">
<application>
<meta-data android:name="applovin.sdk.key" android:value="5WfZLCGTQmDr6Mf7BBEf5blVwrf8VBMJSmwUSq9-1q5bPpCH_OGAWEP2z2lRkmonLgPzG6gbL4DlvUF9frFmt6" />
</application>
</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="ir.tapsell.mediation">
<application>
<meta-data android:name="ir.tapsell.mediation.APPLICATION_KEY" android:value="a12e38ed-f1fc-4c76-b638-55f06c103066" />
</application>
</manifest>
Binary file modified Assets/Plugins/Android/googlemobileads-unity.aar
Binary file not shown.
13 changes: 7 additions & 6 deletions Assets/Plugins/Android/mainTemplate.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Android Resolver Dependencies Start
implementation 'com.google.code.gson:gson:2.8.5' // Assets/GoogleMobileAdsNative/Editor/GoogleMobileAdsNativeDependencies.xml:3
implementation 'ir.tapsell.mediation.adapter:admob-unity:1.0.1-beta04' // Assets/Tapsell/Mediation/Adapter/Admob/Editor/AdmobAdapterDependencies.xml:7
implementation 'ir.tapsell.mediation.adapter:applovin-unity:1.0.1-beta04' // Assets/Tapsell/Mediation/Adapter/Applovin/Editor/ApplovinAdapterDependencies.xml:7
implementation 'ir.tapsell.mediation.adapter:ironsource-unity:1.0.1-beta04' // Assets/Tapsell/Mediation/Adapter/IronSource/Editor/IronSourceAdapterDependencies.xml:3
implementation 'ir.tapsell.mediation.adapter:legacy-unity:1.0.1-beta04' // Assets/Tapsell/Mediation/Adapter/Legacy/Editor/LegacyAdapterDependencies.xml:3
implementation 'ir.tapsell.mediation.adapter:mintegral-unity:1.0.0-beta10' // Assets/Tapsell/Mediation/Adapter/Mintegral/Editor/MintegralAdapterDependencies.xml:8
implementation 'ir.tapsell.mediation:tapsell-unity:1.0.1-beta04' // Assets/Tapsell/Mediation/Editor/MediationDependencies.xml:3
implementation 'ir.tapsell.mediation.adapter:admob-unity:1.0.1-beta07' // Assets/Tapsell/Mediation/Adapter/Admob/Editor/AdmobAdapterDependencies.xml:7
implementation 'ir.tapsell.mediation.adapter:applovin-unity:1.0.1-beta07' // Assets/Tapsell/Mediation/Adapter/Applovin/Editor/ApplovinAdapterDependencies.xml:7
implementation 'ir.tapsell.mediation.adapter:fyber-unity:1.0.1-beta07' // Assets/Tapsell/Mediation/Adapter/Fyber/Editor/FyberAdapterDependencies.xml:7
implementation 'ir.tapsell.mediation.adapter:ironsource-unity:1.0.1-beta07' // Assets/Tapsell/Mediation/Adapter/IronSource/Editor/IronSourceAdapterDependencies.xml:3
implementation 'ir.tapsell.mediation.adapter:legacy-unity:1.0.1-beta07' // Assets/Tapsell/Mediation/Adapter/Legacy/Editor/LegacyAdapterDependencies.xml:3
implementation 'ir.tapsell.mediation.adapter:mintegral-unity:1.0.1-beta07' // Assets/Tapsell/Mediation/Adapter/Mintegral/Editor/MintegralAdapterDependencies.xml:8
implementation 'ir.tapsell.mediation:tapsell-unity:1.0.1-beta07' // Assets/Tapsell/Mediation/Editor/MediationDependencies.xml:3
// Android Resolver Dependencies End
**DEPS**}

Expand Down
2 changes: 1 addition & 1 deletion Assets/Plugins/Android/settingsTemplate.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencyResolutionManagement {
// Android Resolver Repos Start
def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
maven {
url "https://android-sdk.is.com" // Assets/Tapsell/Mediation/Adapter/IronSource/Editor/IronSourceAdapterDependencies.xml:6, Assets/Tapsell/Mediation/Adapter/Admob/Editor/AdmobAdapterDependencies.xml:7, Assets/Tapsell/Mediation/Adapter/Applovin/Editor/ApplovinAdapterDependencies.xml:7, Assets/Tapsell/Mediation/Adapter/Mintegral/Editor/MintegralAdapterDependencies.xml:8
url "https://android-sdk.is.com" // Assets/Tapsell/Mediation/Adapter/IronSource/Editor/IronSourceAdapterDependencies.xml:6, Assets/Tapsell/Mediation/Adapter/Admob/Editor/AdmobAdapterDependencies.xml:7, Assets/Tapsell/Mediation/Adapter/Applovin/Editor/ApplovinAdapterDependencies.xml:7, Assets/Tapsell/Mediation/Adapter/Fyber/Editor/FyberAdapterDependencies.xml:7, Assets/Tapsell/Mediation/Adapter/Mintegral/Editor/MintegralAdapterDependencies.xml:8
}
maven {
url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" // Assets/Tapsell/Mediation/Adapter/Mintegral/Editor/MintegralAdapterDependencies.xml:8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Tapsell.Mediation.Adapter.Admob
{
internal static class AdmobAndroidCaller
{
private static readonly AndroidJavaClass AndroidClass = new("ir.tapsell.mediation.adapter.admob.unity.Admob");
private static readonly AndroidJavaClass AndroidClass = new AndroidJavaClass("ir.tapsell.mediation.adapter.admob.unity.Admob");

internal static void Call(string methodName, params object[] args)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dependencies>
<androidPackages>
<androidPackage spec="ir.tapsell.mediation.adapter:admob-unity:1.0.1-beta04">
<androidPackage spec="ir.tapsell.mediation.adapter:admob-unity:1.0.1-beta07">
<repositories>
<repository>https://android-sdk.is.com</repository>
</repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ private protected override string PluginName()

private protected override string ManifestRelativePath()
{
return "Plugins/Android/TapsellMediationAdmobAdapterPlugin.androidlib/AndroidManifest.xml";
#if UNITY_2021_2_OR_NEWER
return "Plugins/Android/TapsellMediationAdmobAdapterPlugin/AndroidManifest.xml";
#else
return "Plugins/Android/AndroidManifest.xml";
#endif
}

private protected override string MetadataApplicationKey()
Expand Down
12 changes: 6 additions & 6 deletions Assets/Tapsell/Mediation/Adapter/Admob/NativeAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ internal class NativeAdapter
{
private static NativeAdapter _instance;

private readonly Dictionary<string, NativeAd> _ads = new();
private readonly Dictionary<string, NativeAd> _ads = new Dictionary<string, NativeAd>();

// Since Admob impression callback is not always called, we call the listener in multiple triggers.
// This List is used to prevent multiple calls.
private readonly List<string> _impressionCalled = new();
private readonly List<string> _impressionCalled = new List<string>();

// Since Admob click callback is not always called, we call the listener in both open and click triggers.
// For each filled ad there can be only one click source activated.
private readonly Dictionary<string, ClickCallbackSource> _clickCallSources = new();
private readonly Dictionary<string, ClickCallbackSource> _clickCallSources = new Dictionary<string, ClickCallbackSource>();

private static class AndroidAPIs
{
Expand Down Expand Up @@ -51,9 +51,9 @@ internal void RequestNativeAd(NativeRequestInfo info)
adLoader.OnNativeAdLoaded += (_, args) => OnAdLoadSuccess(info.requestId, args.nativeAd);
adLoader.OnAdFailedToLoad += (_, args) => OnAdLoadFailure(info.requestId, args);

adLoader.OnNativeAdClicked += (_, _) => OnAdClick(info.requestId);
adLoader.OnNativeAdImpression += (_, _) => OnAdImpression(info.requestId);
adLoader.OnNativeAdOpening += (_, _) => OnAdOpened(info.requestId);
adLoader.OnNativeAdClicked += (_, args) => OnAdClick(info.requestId);
adLoader.OnNativeAdImpression += (_, args) => OnAdImpression(info.requestId);
adLoader.OnNativeAdOpening += (_, args) => OnAdOpened(info.requestId);

adLoader.LoadAd(new AdRequest());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dependencies>
<androidPackages>
<androidPackage spec="ir.tapsell.mediation.adapter:applovin-unity:1.0.1-beta04">
<androidPackage spec="ir.tapsell.mediation.adapter:applovin-unity:1.0.1-beta07">
<repositories>
<repository>https://android-sdk.is.com</repository>
</repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ private protected override string PluginName()

private protected override string ManifestRelativePath()
{
return "Plugins/Android/TapsellMediationApplovinAdapterPlugin.androidlib/AndroidManifest.xml";
#if UNITY_2021_2_OR_NEWER
return "Plugins/Android/TapsellMediationApplovinAdapterPlugin/AndroidManifest.xml";
#else
return "Plugins/Android/AndroidManifest.xml";
#endif

}

private protected override string MetadataApplicationKey()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<dependencies>
<!-- <androidPackages>-->
<!-- <androidPackage spec="ir.tapsell.mediation.adapter:chartboost-unity:1.0.1-beta07" />-->
<!-- <repositories>-->
<!-- <repository>https://cboost.jfrog.io/artifactory/chartboost-ads</repository>-->
<!-- <repository>https://cboost.jfrog.io/ui/native/chartboost-mediation</repository>-->
<!-- <repository>https://android-sdk.is.com</repository>-->
<!-- </repositories>-->
<!-- </androidPackages>-->
</dependencies>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<dependencies>
<androidPackages>
<androidPackage spec="ir.tapsell.mediation.adapter:fyber-unity:1.0.1-beta07">
<repositories>
<repository>https://android-sdk.is.com</repository>
</repositories>
</androidPackage>
</androidPackages>
</dependencies>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dependencies>
<androidPackages>
<androidPackage spec="ir.tapsell.mediation.adapter:ironsource-unity:1.0.1-beta04" />
<androidPackage spec="ir.tapsell.mediation.adapter:ironsource-unity:1.0.1-beta07" />
<repositories>
<repository>https://android-sdk.is.com</repository>
</repositories>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<dependencies>
<androidPackages>
<androidPackage spec="ir.tapsell.mediation.adapter:legacy-unity:1.0.1-beta04" />
<androidPackage spec="ir.tapsell.mediation.adapter:legacy-unity:1.0.1-beta07" />
</androidPackages>
</dependencies>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Tapsell.Mediation.Adapter.Legacy
{
internal static class LegacyAndroidCaller
{
private static readonly AndroidJavaClass AndroidClass = new("ir.tapsell.mediation.adapter.legacy.unity.Legacy");
private static readonly AndroidJavaClass AndroidClass = new AndroidJavaClass("ir.tapsell.mediation.adapter.legacy.unity.Legacy");

internal static void Call(string methodName, params object[] args)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<dependencies>
<!-- <androidPackages>-->
<!-- <androidPackage spec="ir.tapsell.mediation.adapter:liftoff-unity:1.0.1-beta07">-->
<!-- <repositories>-->
<!-- <repository>https://android-sdk.is.com</repository>-->
<!-- </repositories>-->
<!-- </androidPackage>-->
<!-- </androidPackages>-->
</dependencies>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<dependencies>
<androidPackages>
<androidPackage spec="ir.tapsell.mediation.adapter:mintegral-unity:1.0.0-beta10">
<androidPackage spec="ir.tapsell.mediation.adapter:mintegral-unity:1.0.1-beta07">
<repositories>
<repository>https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea</repository>
<repository>https://android-sdk.is.com</repository>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<dependencies>
<!-- <androidPackages>-->
<!-- <androidPackage spec="ir.tapsell.mediation.adapter:unityads-unity:1.0.1-beta07">-->
<!-- <repositories>-->
<!-- <repository>https://android-sdk.is.com</repository>-->
<!-- </repositories>-->
<!-- </androidPackage>-->
<!-- </androidPackages>-->
</dependencies>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<dependencies>
<!-- <androidPackages>-->
<!-- <androidPackage spec="ir.tapsell.mediation.adapter:wortise-unity:1.0.1-beta07">-->
<!-- <repositories>-->
<!-- <repository>https://maven.wortise.com/artifactory/public</repository>-->
<!-- <repository>https://artifact.bytedance.com/repository/pangle</repository>-->
<!-- <repository>https://android-sdk.is.com</repository>-->
<!-- </repositories>-->
<!-- </androidPackage>-->
<!-- </androidPackages>-->
</dependencies>
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private static string AddPackageIfNotPresent(string currentValue, string newPack
var trimmedValue = currentValue.Trim();
if (trimmedValue.Length == 0) return newPackage;

if (trimmedValue.Split(",").Any(package => package.Trim().Equals(newPackage)))
if (trimmedValue.Split(',').Any(package => package.Trim().Equals(newPackage)))
{
return currentValue;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Tapsell/Mediation/Editor/MediationDependencies.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<dependencies>
<androidPackages>
<androidPackage spec="ir.tapsell.mediation:tapsell-unity:1.0.1-beta04" />
<androidPackage spec="ir.tapsell.mediation:tapsell-unity:1.0.1-beta07" />
</androidPackages>
</dependencies>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ private protected override string PluginName()

private protected override string ManifestRelativePath()
{
return "Plugins/Android/TapsellMediationPlugin.androidlib/AndroidManifest.xml";
#if UNITY_2021_2_OR_NEWER
return "Plugins/Android/TapsellMediationPlugin/AndroidManifest.xml";
#else
return "Plugins/Android/AndroidManifest.xml";
#endif
}

private protected override string MetadataApplicationKey()
Expand Down
28 changes: 18 additions & 10 deletions Assets/Tapsell/Mediation/Editor/Utils/PropertiesHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using UnityEngine;

namespace Tapsell.Mediation.Editor.Utils
{
Expand Down Expand Up @@ -99,11 +98,9 @@ public static IDictionary<string, string> Load(TextReader reader)

public static void Write(IDictionary<string, string> properties, TextWriter writer)
{
foreach(var (key, value) in properties)
foreach(KeyValuePair<string, string> pair in properties)
{
// print the key and value
// Debug.LogError("key: " + key + ", value: " + value);
writer.Write(key + "=" + value + "\n");
writer.Write(pair.Key + "=" + pair.Value + "\n");
}
}

Expand Down Expand Up @@ -198,7 +195,18 @@ private static string RemoveLeadingWhiteSpaces(string str)

private static string RemoveLastChar(string str)
{
#if UNITY_2021_2_OR_NEWER
return str[..^1];
#else
if (str.Length > 0)
{
return str.Substring(0, str.Length - 1);
}
else
{
return str;
}
#endif
}

private static KeyValuePair<string, string>? ParseLine(string line)
Expand Down Expand Up @@ -409,12 +417,12 @@ private static string ExtractValue(string line, int index)

private static bool IsWhiteSpace(char c)
{
return c is ' ' or '\t' or '\f';
return c == ' ' || c == '\t' || c == '\f';
}

private static bool IsSeparator(char c)
{
return c is '=' or ':';
return c == '=' || c == ':';
}

/// <summary>
Expand All @@ -428,19 +436,19 @@ private static bool IsSeparator(char c)
private static int? HexToInt(char c)
{
// 0-9
if (c is >= '0' and <= '9')
if (c >= '0' && c <= '9')
{
return c - '0';
}

// A-F
if (c is >= 'A' and <= 'F')
if (c >= 'A' && c <= 'F')
{
return c - 'A' + 10;
}

// a-f
if (c is >= 'a' and <= 'f')
if (c >= 'a' && c <= 'f')
{
return c - 'a' + 10;
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Tapsell/Mediation/MediatorAndroidCaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Tapsell.Mediation
{
internal static class MediatorAndroidCaller
{
private static readonly AndroidJavaClass AndroidClass = new("ir.tapsell.mediation.Tapsell");
private static readonly AndroidJavaClass AndroidClass = new AndroidJavaClass("ir.tapsell.mediation.Tapsell");

internal static void Call(string methodName, params object[] args)
{
Expand Down
4 changes: 3 additions & 1 deletion Assets/Tapsell/Mediation/Request/BannerSize.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
namespace Tapsell.Mediation.Request
{
public enum BannerSize {
Banner30050,
Banner32050,
Banner320100,
Banner250250,
Banner300250,
Banner46860,
Banner72890,
Banner160600
Banner160600,
BannerAdaptive
}
}
2 changes: 1 addition & 1 deletion Assets/Tapsell/Mediation/Request/RequestCourier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace Tapsell.Mediation.Request
internal class RequestCourier
{
private static RequestCourier _instance;
private readonly Dictionary<string, IRequestListener> _listeners = new();
private readonly Dictionary<string, IRequestListener> _listeners = new Dictionary<string, IRequestListener>();

private static class NativeRequestAPIs
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 64f00de1f65c4718951b5554fd4bfa1e, type: 3}
m_Name: TapsellMediationSettings
m_EditorClassIdentifier:
tapsellAndroidAppKey: 76798342-99a7-4a5f-bf5a-60a088d5dcfb
tapsellAndroidAppKey: a12e38ed-f1fc-4c76-b638-55f06c103066
tapsellAndroidAppMarketKey:
admobAdapterSignature: ca-app-pub-6201798499291567~9611758993
applovinAdapterSignature: 5WfZLCGTQmDr6Mf7BBEf5blVwrf8VBMJSmwUSq9-1q5bPpCH_OGAWEP2z2lRkmonLgPzG6gbL4DlvUF9frFmt6
2 changes: 1 addition & 1 deletion Assets/Tapsell/Mediation/Show/Native/NativeAdViewHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ internal class NativeAdViewHolder
{
private static NativeAdViewHolder _instance;

private readonly Dictionary<string, NativeAdView> _adViews = new();
private readonly Dictionary<string, NativeAdView> _adViews = new Dictionary<string, NativeAdView>();

private NativeAdViewHolder() {}

Expand Down
Loading

0 comments on commit 36c71d0

Please sign in to comment.