EFSDK接口、测试

This commit is contained in:
玉峰 2025-09-01 16:27:45 +08:00
parent 2d2426d021
commit 639865ca86
11 changed files with 533 additions and 41 deletions

View File

@ -1 +1 @@
<?xml version="1.0" encoding="utf-8"?><resources><string name="com.crashlytics.android.build_id" translatable="false">c45ec7aa-6b06-44f5-a853-c0fb3a4e9252</string></resources> <?xml version="1.0" encoding="utf-8"?><resources><string name="com.crashlytics.android.build_id" translatable="false">9bdc54ad-1cc2-4efd-a721-547163c61c6b</string></resources>

View File

@ -4,16 +4,15 @@ apply plugin: 'com.android.library'
dependencies { dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
// Android Resolver Dependencies Start // Android Resolver Dependencies Start
implementation 'androidx.annotation:annotation:1.2.0' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:8 implementation 'androidx.annotation:annotation:1.2.0' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:8
implementation 'androidx.appcompat:appcompat:1.6.1' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:6 implementation 'androidx.appcompat:appcompat:1.6.1' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:6
implementation 'androidx.browser:browser:1.4.0' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/Editor/Dependencies.xml:4 implementation 'androidx.browser:browser:1.4.0' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/Editor/Dependencies.xml:4
implementation 'androidx.constraintlayout:constraintlayout:2.1.4' // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:12 implementation 'androidx.constraintlayout:constraintlayout:2.1.4' // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:12
implementation 'androidx.lifecycle:lifecycle-process:2.6.2' // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:17 implementation 'androidx.lifecycle:lifecycle-process:2.6.2' // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:17
implementation 'androidx.media3:media3-exoplayer:1.0.0-alpha01' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:5 implementation 'androidx.media3:media3-exoplayer:1.0.0-alpha01' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:5
// implementation 'androidx.recyclerview:recyclerview:1.1.0' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/gtm/Editor/Dependencies.xml:7
implementation 'androidx.recyclerview:recyclerview:1.2.1' // Assets/MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml:9 implementation 'androidx.recyclerview:recyclerview:1.2.1' // Assets/MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml:9
implementation 'com.adjust.sdk:adjust-android:5.4.2' // Assets/rd3/Adjust/Native/Editor/Dependencies.xml:5 implementation 'com.adjust.sdk:adjust-android:5.4.2' // Assets/Adjust/Native/Editor/Dependencies.xml:5
implementation 'com.android.installreferrer:installreferrer:2.2' // Assets/rd3/Adjust/Native/Editor/Dependencies.xml:7 implementation 'com.android.installreferrer:installreferrer:2.2' // Assets/Adjust/Native/Editor/Dependencies.xml:7
implementation 'com.applovin.mediation:bigoads-adapter:5.5.1.2' // Assets/MaxSdk/Mediation/BigoAds/Editor/Dependencies.xml:4 implementation 'com.applovin.mediation:bigoads-adapter:5.5.1.2' // Assets/MaxSdk/Mediation/BigoAds/Editor/Dependencies.xml:4
implementation 'com.applovin.mediation:bytedance-adapter:7.5.0.3.0' // Assets/MaxSdk/Mediation/ByteDance/Editor/Dependencies.xml:8 implementation 'com.applovin.mediation:bytedance-adapter:7.5.0.3.0' // Assets/MaxSdk/Mediation/ByteDance/Editor/Dependencies.xml:8
implementation 'com.applovin.mediation:fyber-adapter:8.3.8.0' // Assets/MaxSdk/Mediation/Fyber/Editor/Dependencies.xml:4 implementation 'com.applovin.mediation:fyber-adapter:8.3.8.0' // Assets/MaxSdk/Mediation/Fyber/Editor/Dependencies.xml:4
@ -23,33 +22,33 @@ dependencies {
implementation 'com.applovin.mediation:moloco-adapter:4.0.0.0' // Assets/MaxSdk/Mediation/Moloco/Editor/Dependencies.xml:4 implementation 'com.applovin.mediation:moloco-adapter:4.0.0.0' // Assets/MaxSdk/Mediation/Moloco/Editor/Dependencies.xml:4
implementation 'com.applovin.mediation:unityads-adapter:4.16.1.0' // Assets/MaxSdk/Mediation/UnityAds/Editor/Dependencies.xml:4 implementation 'com.applovin.mediation:unityads-adapter:4.16.1.0' // Assets/MaxSdk/Mediation/UnityAds/Editor/Dependencies.xml:4
implementation 'com.applovin.mediation:vungle-adapter:7.5.1.0' // Assets/MaxSdk/Mediation/Vungle/Editor/Dependencies.xml:4 implementation 'com.applovin.mediation:vungle-adapter:7.5.1.0' // Assets/MaxSdk/Mediation/Vungle/Editor/Dependencies.xml:4
implementation 'com.applovin:applovin-sdk:13.3.1' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/applovin/Editor/Dependencies.xml:3 // implementation 'com.applovin:applovin-sdk:13.2.0' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/applovin/Editor/Dependencies.xml:3
implementation 'com.applovin:applovin-sdk:13.3.1' // Assets/MaxSdk/AppLovin/Editor/Dependencies.xml:4
// implementation 'com.bigossp:bigo-ads:5.0.0' // Assets/BigoSDK/Editor/Dependencies.xml:11 // implementation 'com.bigossp:bigo-ads:5.0.0' // Assets/BigoSDK/Editor/Dependencies.xml:11
implementation 'com.bigossp:bigo-ads:5.3.0' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/bigo/Editor/Dependencies.xml:3 implementation 'com.bigossp:bigo-ads:5.3.0' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/bigo/Editor/Dependencies.xml:3
implementation 'com.fyber:marketplace-sdk:8.3.7' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/fyber/Editor/Dependencies.xml:3 implementation 'com.earn.money:sdk:+' // Assets/EFSDK/Editor/Dependencies.xml:10
// implementation 'com.google.android.gms:play-services-ads:24.4.0' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/admob/Editor/Dependencies.xml:3 implementation 'com.fyber:marketplace-sdk:8.3.5' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/fyber/Editor/Dependencies.xml:3
// implementation 'com.google.android.gms:play-services-ads:24.0.0' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/admob/Editor/Dependencies.xml:3
implementation 'com.google.android.gms:play-services-ads:24.5.0' // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7 implementation 'com.google.android.gms:play-services-ads:24.5.0' // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7
// implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/vungle/Editor/Dependencies.xml:5 implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/vungle/Editor/Dependencies.xml:5
implementation 'com.google.android.gms:play-services-ads-identifier:18.2.0' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/pangle/Editor/Dependencies.xml:7 implementation 'com.google.android.gms:play-services-base:18.7.2' // Assets/Firebase/Editor/AppDependencies.xml:17
implementation 'com.google.android.gms:play-services-base:18.7.2' // Assets/rd3/Firebase/Editor/AppDependencies.xml:17 implementation 'com.google.android.gms:play-services-basement:18.1.0' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/vungle/Editor/Dependencies.xml:4
implementation 'com.google.android.gms:play-services-basement:18.1.0' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/vungle/Editor/Dependencies.xml:4 implementation 'com.google.android.material:material:1.2.1' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:7
implementation 'com.google.android.material:material:1.2.1' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:7
implementation 'com.google.android.ump:user-messaging-platform:3.2.0' // Assets/GoogleMobileAds/Editor/GoogleUmpDependencies.xml:7 implementation 'com.google.android.ump:user-messaging-platform:3.2.0' // Assets/GoogleMobileAds/Editor/GoogleUmpDependencies.xml:7
implementation 'com.google.firebase:firebase-analytics:23.0.0' // Assets/rd3/Firebase/Editor/RemoteConfigDependencies.xml:15 implementation 'com.google.firebase:firebase-analytics:23.0.0' // Assets/Firebase/Editor/RemoteConfigDependencies.xml:15
implementation 'com.google.firebase:firebase-analytics-unity:13.1.0' // Assets/rd3/Firebase/Editor/AnalyticsDependencies.xml:18 implementation 'com.google.firebase:firebase-analytics-unity:13.1.0' // Assets/Firebase/Editor/AnalyticsDependencies.xml:18
implementation 'com.google.firebase:firebase-app-unity:13.1.0' // Assets/rd3/Firebase/Editor/AppDependencies.xml:22 implementation 'com.google.firebase:firebase-app-unity:13.1.0' // Assets/Firebase/Editor/AppDependencies.xml:22
implementation 'com.google.firebase:firebase-common:22.0.0' // Assets/rd3/Firebase/Editor/AppDependencies.xml:13 implementation 'com.google.firebase:firebase-common:22.0.0' // Assets/Firebase/Editor/AppDependencies.xml:13
implementation 'com.google.firebase:firebase-config:23.0.0' // Assets/rd3/Firebase/Editor/RemoteConfigDependencies.xml:13 implementation 'com.google.firebase:firebase-config:23.0.0' // Assets/Firebase/Editor/RemoteConfigDependencies.xml:13
implementation 'com.google.firebase:firebase-config-unity:13.1.0' // Assets/rd3/Firebase/Editor/RemoteConfigDependencies.xml:20 implementation 'com.google.firebase:firebase-config-unity:13.1.0' // Assets/Firebase/Editor/RemoteConfigDependencies.xml:20
implementation 'com.google.firebase:firebase-crashlytics-ndk:20.0.0' // Assets/rd3/Firebase/Editor/CrashlyticsDependencies.xml:13 implementation 'com.google.firebase:firebase-crashlytics-ndk:20.0.0' // Assets/Firebase/Editor/CrashlyticsDependencies.xml:13
implementation 'com.google.firebase:firebase-crashlytics-unity:13.1.0' // Assets/rd3/Firebase/Editor/CrashlyticsDependencies.xml:20 implementation 'com.google.firebase:firebase-crashlytics-unity:13.1.0' // Assets/Firebase/Editor/CrashlyticsDependencies.xml:20
implementation 'com.mbridge.msdk.oversea:mbridge_android_sdk:16.9.71' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/gtm/Editor/Dependencies.xml:6 implementation 'com.pangle.global:pag-sdk:7.2.0.6' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/pangle/Editor/Dependencies.xml:6
implementation 'com.pangle.global:pag-sdk:7.2.0.6' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/pangle/Editor/Dependencies.xml:6 implementation 'com.unity3d.ads:unity-ads:4.14.0' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/unityads/Editor/Dependencies.xml:3
implementation 'com.unity3d.ads:unity-ads:4.14.0' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/unityads/Editor/Dependencies.xml:3 implementation 'com.vungle:vungle-ads:7.4.3' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/vungle/Editor/Dependencies.xml:3
implementation 'com.vungle:vungle-ads:7.5.0' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/vungle/Editor/Dependencies.xml:3 implementation 'io.github.kwainetwork:adApi:1.2.15' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:3
implementation 'io.github.kwainetwork:adApi:1.2.19' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:3 implementation 'io.github.kwainetwork:adImpl:1.2.15' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:4
implementation 'io.github.kwainetwork:adImpl:1.2.19' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:4 implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10' // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:9
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.10' // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/kwai/Editor/Dependencies.xml:9
// Android Resolver Dependencies End // Android Resolver Dependencies End
**DEPS**} **DEPS**}

View File

@ -19,19 +19,28 @@ dependencyResolutionManagement {
// Android Resolver Repos Start // Android Resolver Repos Start
def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/") def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
maven { maven {
url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/gtm/Editor/Dependencies.xml:5, Assets/MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml:8 url "https://artifact.bytedance.com/repository/pangle" // Assets/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/pangle/Editor/Dependencies.xml:5, Assets/MaxSdk/Mediation/ByteDance/Editor/Dependencies.xml:8
}
maven {
url "https://artifact.bytedance.com/repository/pangle" // Assets/rd3/ShuShu/ThinkupTpnPlugin/AnyThinkAds/Plugins/Android/NonChina/mediation/pangle/Editor/Dependencies.xml:5, Assets/MaxSdk/Mediation/ByteDance/Editor/Dependencies.xml:8
} }
maven { maven {
url "https://repo1.maven.org/maven2/" // Assets/BigoSDK/Editor/Dependencies.xml:11 url "https://repo1.maven.org/maven2/" // Assets/BigoSDK/Editor/Dependencies.xml:11
} }
maven {
url "https://repo.dgtverse.cn/repository/maven-public/" // Assets/EFSDK/Editor/Dependencies.xml:10
}
maven {
url (unityProjectPath + "/Assets/GeneratedLocalRepo/Firebase/m2repository") // Assets/Firebase/Editor/AnalyticsDependencies.xml:18, Assets/Firebase/Editor/AppDependencies.xml:22, Assets/Firebase/Editor/CrashlyticsDependencies.xml:20, Assets/Firebase/Editor/RemoteConfigDependencies.xml:20
}
maven { maven {
url "https://maven.google.com/" // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7, Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:12, Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:17, Assets/GoogleMobileAds/Editor/GoogleUmpDependencies.xml:7 url "https://maven.google.com/" // Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:7, Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:12, Assets/GoogleMobileAds/Editor/GoogleMobileAdsDependencies.xml:17, Assets/GoogleMobileAds/Editor/GoogleUmpDependencies.xml:7
} }
maven { maven {
url (unityProjectPath + "/Assets/Firebase/m2repository") // Assets/rd3/Firebase/Editor/AnalyticsDependencies.xml:18, Assets/rd3/Firebase/Editor/AppDependencies.xml:22, Assets/rd3/Firebase/Editor/CrashlyticsDependencies.xml:20, Assets/rd3/Firebase/Editor/RemoteConfigDependencies.xml:20 url "https://dl-maven-android.mintegral.com/repository/mbridge_android_sdk_oversea" // Assets/MaxSdk/Mediation/Mintegral/Editor/Dependencies.xml:8, Assets/EFSDK/Editor/Dependencies.xml:10
}
maven {
url "https://android-sdk.is.com/" // Assets/EFSDK/Editor/Dependencies.xml:10
}
maven {
url "https://artifact.bytedance.com/repository/pangle/" // Assets/EFSDK/Editor/Dependencies.xml:10
} }
mavenLocal() mavenLocal()
// Android Resolver Repos End // Android Resolver Repos End

View File

@ -1,6 +1,8 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using EFSDK;
using Firebase.RemoteConfig;
using Script.Common; using Script.Common;
using Script.SDKManager.AdsSDKManager.Constant; using Script.SDKManager.AdsSDKManager.Constant;
using Script.Utils; using Script.Utils;
@ -21,6 +23,7 @@ public class AppSDKManager : MonoBehaviour
AdjustManager.Instance.Init(); AdjustManager.Instance.Init();
ShuShuMangage.Instance.Init(); ShuShuMangage.Instance.Init();
AdsSDKManager.Instance.InitSDK(); AdsSDKManager.Instance.InitSDK();
EFSdkManager.Instance.Init();
} }
/// <summary> /// <summary>
@ -71,4 +74,411 @@ public class AppSDKManager : MonoBehaviour
}); });
} }
} }
#region EFSDK
/// <summary>
/// 展示WebView
/// </summary>
/// <param name="id">标签id,存在多个WebView时,用于标识WebView</param>
/// <param name="url">网址</param>
/// <param name="pRect">WebView展示区域的RectTransform</param>
/// <param name="pCam">可不传;传值的话要传正交相机</param>
public void ShowWebView(int id, string url, RectTransform pRect, Camera pCam = null)
{
if (Application.isEditor)
{
return;
}
EFSdk.get().ShowWebView(id, url, pRect, pCam);
}
/// <summary>
/// 移除所有原生WebView, 回到游戏时调用
/// </summary>
/// <returns></returns>
public void RemoveAll()
{
if (Application.isEditor)
{
return;
}
EFSdk.get().RemoveAll();
}
/// <summary>
/// 刷新当前页面
/// </summary>
/// <returns></returns>
public void Refresh()
{
if (Application.isEditor)
{
return;
}
EFSdk.get().Refresh();
}
/// <summary>
/// 回上一页
/// </summary>
/// <returns></returns>
public void GoBack()
{
if (Application.isEditor)
{
return;
}
EFSdk.get().CanGoback((IsGoback) =>
{
if (IsGoback)
{
EFSdk.get().GoBack();
}
});
}
/// <summary>
/// 是否手动控制漂浮道具显示/隐藏
/// SDK内默认当H5页面加载完成后自动显示漂浮道具
/// </summary>
/// <param name="autoShow">true: 自动显示/隐藏道具 false: 游戏主动控制道具显示/隐藏</param>
/// <returns></returns>
public void AutoShowFloat(bool autoShow)
{
if (Application.isEditor)
{
return;
}
EFSdk.get().AutoShowFloat(false);
}
/// <summary>
/// 新增接口飘金币
/// </summary>
/// <param name="id"></param>
/// <param name="res">悬浮金币按钮的图片资源,传字符串 0 或 1 0:金币图 1:红点宝箱图 </param>
/// <returns></returns>
public void ShowFloatCoin(String res)
{
if (Application.isEditor)
{
return;
}
var remoteConfig = FireBaseRemoteConfigManager.Instance.GetRemoteConfigInt("coin_position", 3);
if (remoteConfig <= 0)
{
remoteConfig = 3;
}
if (remoteConfig > 10)
{
remoteConfig = 3;
}
EFSdk.get().SetFloatCoinRes(res);
EFSdk.get().ShowFloatCoin(remoteConfig);
}
/// <summary>
/// 隐藏金币
/// </summary>
/// <returns></returns>
public void HideFloatCoin()
{
if (Application.isEditor)
{
return;
}
EFSdk.get().HideFloatCoin();
}
/// <param name="startId">宝箱动画起始位置</param>
/// <param name="endId">宝箱动画移动结束位置</param>
/// <param name="fly_first_time">首次delay时间</param>
/// <param name="fly_gap_time">每次漂浮移动的时间间隔</param>
/// <returns></returns>
public void ShowBalloon(int startId, int endId, int fly_first_time, int fly_gap_time)
{
if (Application.isEditor)
{
return;
}
var startFlyIndex = FireBaseRemoteConfigManager.Instance.GetRemoteConfigInt("start_fly", 40);
var endFlyIndex = FireBaseRemoteConfigManager.Instance.GetRemoteConfigInt("end_fly", 60);
var flyFirstTime = FireBaseRemoteConfigManager.Instance.GetRemoteConfigInt("fly_first_time", 3);
var flyGapTime = FireBaseRemoteConfigManager.Instance.GetRemoteConfigInt("fly_gap_time", 15);
EFSdk.get().ShowBalloon(startFlyIndex, endFlyIndex, flyFirstTime, flyGapTime);
}
/// <summary>
/// 隐藏气球
/// </summary>
/// <returns></returns>
public void HideBalloon()
{
if (Application.isEditor)
{
return;
}
EFSdk.get().HideBalloon();
}
/// <summary>
/// 设置推送开关, SDK默认关闭通知
/// </summary>
/// <param name="isOpen"></param>
public void SetPushSwitch(bool isOpen)
{
if (Application.isEditor)
{
return;
}
EFSdk.get().SetPushSwitch(isOpen);
}
/// <summary>
/// 向SDK上报当前金币总数,每次金币变化都要调用一次
/// </summary>
/// <param name="totalGold"></param>
public void SendTotalGold2SDK(int totalGold)
{
if (Application.isEditor)
{
return;
}
EFSdk.get().SendTotalGold2SDK(totalGold);
}
/// <summary>
/// 向SDK上报当前要提现的现金额,每次变化都要调用一次
/// </summary>
/// <param name="cashNum"></param>
public void SendCashNum2SDK(double cashNum)
{
if (Application.isEditor)
{
return;
}
EFSdk.get().SendCashNum2SDK(cashNum);
}
/// <summary>
/// 向SDK上报 游戏名字(当前语言的),每次语言变化都上报
/// </summary>
/// <param name="gameName"></param>
public void SetGameName(string gameName)
{
if (Application.isEditor)
{
return;
}
EFSdk.get().SetGameName(gameName);
}
/// <summary>
/// 设置当前游戏语言是否是 巴西语
///
/// </summary>
/// <param name="isPT">巴西语传 true, 其他的都传 false </param>
public void SetCurrLang(bool isPT)
{
if (Application.isEditor)
{
return;
}
EFSdk.get().SetCurrLang(isPT);
}
/// <summary>
/// 消息类通知弹出间隔,SDK默认设置为60秒在线参数控制-Key: messagenotif Value:60
/// </summary>
/// <param name="timeSeconds"></param>
public void SetPushMessagenotif()
{
if (Application.isEditor)
{
return;
}
int timeSeconds = FireBaseRemoteConfigManager.Instance.GetRemoteConfigInt("messagenotif", 60);
EFSdk.get().SetPushMessagenotif(timeSeconds);
}
/// <summary>
/// 持续性通知在进入游戏时弹出的时间间隔,SDK默认设置为300秒在线参数控制 -Key:persistentnotif Value:300
/// </summary>
/// <param name="timeSeconds"></param>
public void SetPushPersistentnotif()
{
if (Application.isEditor)
{
return;
}
int timeSeconds = FireBaseRemoteConfigManager.Instance.GetRemoteConfigInt("persistentnotif", 300);
EFSdk.get().SetPushPersistentnotif(timeSeconds);
}
/// <summary>
/// 每次回调游戏的onResume的时候都调用一次,获取游戏要跳转的页面
/// </summary>
/// <returns>
/// 0 不需要进行任何跳转
/// 1 进行游戏主页
/// 2 进入游戏的金币提现界面
/// 3 进入对应小游戏1界面
/// 4 进入对应小游戏2界面
/// </returns>
public void GetJumpPage()
{
if (Application.isEditor)
{
return;
}
int pageId = EFSdk.get().GetJumpPage();
switch (pageId)
{
case 0:
// Nothing to do
break;
case 1:
// 回到游戏主页
break;
case 2:
// 进入游戏的金币提现界面
break;
case 3:
// 进入对应小游戏1界面
break;
case 4:
// 进入对应小游戏2界面
break;
}
}
/// <summary>
/// 获取当前是否有通知权限
/// </summary>
public bool HasNotifyPermission()
{
if (Application.isEditor)
{
return false;
}
return EFSdk.get().HasNotifyPermission();
}
/// <summary>
/// 请求获取通知权限
/// <param name="action">授权弹窗关闭回调 bool:表示用户是否允许了权限 true:有权限 false:无权限</param>
/// </summary>
public void ReqNotifyPermission(Action<bool> action)
{
if (Application.isEditor)
{
return;
}
// 如果没有通知权限就尝试申请通知权限
if(!HasNotifyPermission())
{
EFSdk.get().ReqNotifyPermission(isgGranted =>
{
//收到回调之后,可以认为权限申请弹窗弹出来了
if (isgGranted)
{
//用户已同意授权
}
else
{
//用户拒绝了授权
}
});
}
}
/// <summary>
/// 满足条件:未领取 R0.1 的 买量用户, 调用这个方法
/// </summary>
public void SubscribeUnclaimed01()
{
if (Application.isEditor)
{
return;
}
EFSdk.get().SubscribeUnclaimed01();
}
/// <summary>
/// 不满足条件:未领取 R0.1 的 买量用户, 调用这个方法
/// </summary>
public void UnSubscribeUnclaimed01()
{
if (Application.isEditor)
{
return;
}
EFSdk.get().UnSubscribeUnclaimed01();
}
/// <summary>
// 满足条件: 在排队中 且 当日R1 未领取 的买量用户, 调用这个方法
/// </summary>
public void SubscribePending1()
{
if (Application.isEditor)
{
return;
}
EFSdk.get().SubscribePending1();
}
/// <summary>
/// 不满足条件: 在排队中 且 当日R1 未领取 的买量用户, 调用这个方法
/// </summary>
public void UnSubscribePending1()
{
if (Application.isEditor)
{
return;
}
EFSdk.get().UnSubscribePending1();
}
/// <summary>
/// 订阅Firebase推送主题
/// </summary>
/// <param name="topic">主题名称</param>
public void SubscribeToTopic(string topic)
{
if (Application.isEditor)
{
return;
}
EFSdk.get().SubscribeToTopic(topic);
}
/// 取消订阅Firebase推送主题
/// </summary>
/// <param name="topic">主题名称</param>
public void UnSubscribeToTopic(string topic)
{
if (Application.isEditor)
{
return;
}
EFSdk.get().UnSubscribeToTopic(topic);
}
/// <summary>
/// 可覆盖广告的Toast
/// </summary>
/// <param name="message"></param>
public void ShowToast(string message)
{
if (Application.isEditor)
{
return;
}
EFSdk.get().ShowToast(message);
}
#endregion
} }

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 7c64ea7790054a1ab434ca0de1bb2652
timeCreated: 1756711229

View File

@ -0,0 +1,46 @@
using EFSDK;
using Firebase.Analytics;
using Script.Utils;
using UnityEngine;
public class EFSdkManager : NormalSingleton<EFSdkManager>
{
public void Init()
{
EFSdk.get().Init((actionType, str) =>
{
if (EFSdk.ActionType.COIN_CLICK == actionType)
{
//TOTO 游戏在此处理 点击金币弹广告的逻辑或其他
}
if (EFSdk.ActionType.BALLOON_CLICK == actionType)
{
//TOTO 游戏在此处理 点击宝箱弹广告的逻辑或其他
}
if (EFSdk.ActionType.COIN_SHOW == actionType)
{
}
if (EFSdk.ActionType.BOX_SHOW == actionType)
{
}
if (EFSdk.ActionType.GAM_LOAD_SUCC == actionType)
{
// 标签id,标识哪个WebView加载成功了
int id = int.Parse(str);
}
});
SetSDKEventCallback();
}
private void SetSDKEventCallback()
{
EFSdk.get().SetSDKEventCallback((eventName, dict) =>
{
FireBaseAnalyticsManager.Instance.LogEvent(eventName, dict);
ShuShuEvent.Instance.Track(eventName, dict);
});
}
}

View File

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 112b724762024ad5946af4fe967ee073
timeCreated: 1756711246

View File

@ -1,4 +1,5 @@
using System.Collections.Generic;
using Firebase.Analytics; using Firebase.Analytics;
using Newtonsoft.Json; using Newtonsoft.Json;
using Script.Common; using Script.Common;
@ -40,6 +41,17 @@ public class FireBaseAnalyticsManager : NormalSingleton<FireBaseAnalyticsManager
{ {
Firebase.Analytics.FirebaseAnalytics.LogEvent(eventName, parameters); Firebase.Analytics.FirebaseAnalytics.LogEvent(eventName, parameters);
} }
public void LogEvent(string eventName, Dictionary<string, string> dict)
{
List<Parameter> parameters = new List<Parameter>();
foreach (var item in dict)
{
Parameter parameter = new Parameter(item.Key, item.Value);
parameters.Add(parameter);
}
Firebase.Analytics.FirebaseAnalytics.LogEvent(eventName, parameters.ToArray());
}
/// <summary> /// <summary>
/// 设置用户属性 /// 设置用户属性

View File

@ -8,8 +8,6 @@ using UnityEngine;
public class FireBaseSDKManager : NormalSingleton<FireBaseSDKManager> public class FireBaseSDKManager : NormalSingleton<FireBaseSDKManager>
{ {
public bool IsInit {private set; get; }
public void Init() public void Init()
{ {
InitSDK(); InitSDK();

View File

@ -1,4 +1,5 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using Script.Utils; using Script.Utils;
using ThinkingData.Analytics; using ThinkingData.Analytics;
@ -36,7 +37,18 @@ public class ShuShuEvent : NormalSingleton<ShuShuEvent>
{ {
TDAnalytics.Track(eventName, properties); TDAnalytics.Track(eventName, properties);
} }
/// <summary>
/// 发送事件
/// </summary>
public void Track(string eventName, Dictionary<string, string> properties)
{
var newProperties = properties.ToDictionary(
pair => pair.Key,
pair => (object)pair.Value
);
TDAnalytics.Track(eventName, newProperties);
}
/// <summary> /// <summary>
/// 数数收益上报 /// 数数收益上报

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2 fileFormatVersion: 2
guid: b218769dd2f8e41f3a8821896e5a13ef guid: 26462fea0f177a5498e4d2cf5671c30a
TextScriptImporter: TextScriptImporter:
externalObjects: {} externalObjects: {}
userData: userData: