using System;
using UnityEngine;

namespace EngineSdkConverter.Unity.SDK
{
    /// <summary>
    /// 与原生平台交互的接口
    /// </summary>
    public abstract class ISDKInterface
    {
        /// <summary>
        /// 初始化接口
        /// </summary>
        public virtual void Init() => throw new NotImplementedException();

        /// <summary>
        /// 初始化SDK
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void InitSDK(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 个性化初始化SDK
        /// </summary>
        /// <param name="initEvent">初始化事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void InitSDK(InitEventBuilder.InitEvent initEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 更新服务器地址
        /// </summary>
        public virtual void UpdateServerUrl(string serverUrl) => throw new NotImplementedException();

        /// <summary>
        /// 更新服务器地址列表
        /// </summary>
        /// <param name="serverUrlList">服务器地址列表</param>
        public virtual void UpdateServerUrlList(string[] serverUrlList) => throw new NotImplementedException();


        /// <summary>
        /// 静默登录
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void SilentLogin(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 静默登录
        /// </summary>
        /// <param name="loginEvent">登录事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void SilentLoginWithParam(LoginEventBuilder.LoginEvent loginEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void Login(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 根据类型登录
        /// </summary>
        /// <param name="loginEvent">登录事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void LoginByType(LoginEventBuilder.LoginEvent loginEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 发送手机验证码
        /// </summary>
        /// <param name="loginEvent">登录事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void SendCode(LoginEventBuilder.LoginEvent loginEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 获取支付方式列表
        /// </summary>
        /// <param name="payEvent">支付事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void Charge(PayEventBuilder.PayEvent payEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 支付
        /// </summary>
        /// <param name="payEvent">支付事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void Pay(PayEventBuilder.PayEvent payEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 获取商品配置
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void GetLocalProductInfo(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 设置推送回调
        /// </summary>
        /// <param name="onReceive">接收推送回调</param>
        /// <param name="onClick">点击推送回调</param>
        public virtual void SetPushResultHandler(Action<string> onReceive, Action<string> onClick) => throw new NotImplementedException();

        /// <summary>
        /// AppsFlyer事件上报
        /// </summary>
        /// <param name="reportEvent">上报事件参数</param>
        public virtual void AppsFlyerEventReport(ReportEventBuilder.ReportEvent reportEvent) => throw new NotImplementedException();

        /// <summary>
        /// 退出登录
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void Logout(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 退出渠道登录
        /// </summary>
        /// <param name="logoutEvent">登出事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void LogoutChannel(LoginEventBuilder.LoginEvent logoutEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 退出游戏
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void ExitGame(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 获取AppsFlyer设备ID
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void GetAppsFlyerDeviceId(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 设置AppsFlyer通用参数
        /// </summary>
        /// <param name="reportEvent">上报事件参数</param>
        public virtual void SetAppsFlyerCommonParam(ReportEventBuilder.ReportEvent reportEvent) => throw new NotImplementedException();

        /// <summary>
        /// 设置Firebase用户属性
        /// </summary>
        /// <param name="reportEvent">上报事件参数</param>
        public virtual void SetFirebaseUserProperty(ReportEventBuilder.ReportEvent reportEvent) => throw new NotImplementedException();

        /// <summary>
        /// 设置Firebase通用参数
        /// </summary>
        /// <param name="reportEvent">上报事件参数</param>
        public virtual void SetFirebaseCommonParam(ReportEventBuilder.ReportEvent reportEvent) => throw new NotImplementedException();

        /// <summary>
        /// Firebase事件上报
        /// </summary>
        /// <param name="reportEvent">上报事件参数</param>
        public virtual void FirebaseEventReport(ReportEventBuilder.ReportEvent reportEvent) => throw new NotImplementedException();

        /// <summary>
        /// 设置GDT通用参数
        /// </summary>
        /// <param name="reportEvent">上报事件参数</param>
        public virtual void SetGDTCommonParam(ReportEventBuilder.ReportEvent reportEvent) => throw new NotImplementedException();

        /// <summary>
        /// GDT事件上报
        /// </summary>
        /// <param name="reportEvent">上报事件参数</param>
        public virtual void GDTEventReport(ReportEventBuilder.ReportEvent reportEvent) => throw new NotImplementedException();

        /// <summary>
        /// 获取可绑定账号列表
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void CanBindList(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 获取已绑定账号列表
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void AlreadyBindList(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 绑定检查
        /// </summary>
        /// <param name="bindEvent">绑定事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void Check(BindEventBuilder.BindEvent bindEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 绑定账号
        /// </summary>
        /// <param name="bindEvent">绑定事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void Bind(BindEventBuilder.BindEvent bindEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 获取手机号绑定的用户列表
        /// </summary>
        /// <param name="bindEvent">绑定事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void GetBindUserList(BindEventBuilder.BindEvent bindEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 设置GA用户属性
        /// </summary>
        /// <param name="reportEvent">上报事件参数</param>
        public virtual void GAProfileTrack(ReportEventBuilder.ReportEvent reportEvent) => throw new NotImplementedException();

        /// <summary>
        /// GA事件上报
        /// </summary>
        /// <param name="reportEvent">上报事件参数</param>
        public virtual void GAEventTrack(ReportEventBuilder.ReportEvent reportEvent) => throw new NotImplementedException();

        /// <summary>
        /// 设置GA通用参数
        /// </summary>
        /// <param name="reportEvent">上报事件参数</param>
        public virtual void SetGACommonParam(ReportEventBuilder.ReportEvent reportEvent) => throw new NotImplementedException();

        /// <summary>
        /// 设置发货回调
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void SetLocalDeliverListener(Action<string, Action, Action<string, string>> callback) => throw new NotImplementedException();

        /// <summary>
        /// 申请通知权限
        /// </summary>
        public virtual void RequestNotificationPermission() => throw new NotImplementedException();

        /// <summary>
        /// 设置防沉迷信息监听
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void SetCertificationListener(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 防沉迷认证
        /// </summary>
        /// <param name="certificationEvent">认证事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void Certificate(CertificationEventBuilder.CertificationEvent certificationEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 获取实名信息
        /// </summary>
        public virtual string GetCertificationInfo() => throw new NotImplementedException();

        /// <summary>
        /// 修改认证信息
        /// </summary>
        /// <param name="certificationEvent">认证事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void ReCertificate(CertificationEventBuilder.CertificationEvent certificationEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 刷新实名信息
        /// </summary>
        public virtual void RefreshCertification() => throw new NotImplementedException();

        /// <summary>
        /// 获取防沉迷启用状态
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual bool IsCertificationEnable() => throw new NotImplementedException();

        /// <summary>
        /// 设置服务器返回语言
        /// </summary>
        /// <param name="serverLanguage">服务器语言</param>
        /// <param name="callback">回调函数</param>
        public virtual void SetServerLanguage(string serverLanguage, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 获取设备ID
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void GetDeviceId(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 人脸识别
        /// </summary>
        /// <param name="yiDunEvent">易盾事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void LiveDetect(YiDunEventBuilder.YiDunEvent yiDunEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 微信授权
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void RequestWXAuthorize(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 获取微信用户信息
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void GetWXAuthInfo(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 获取易盾行为验证码
        /// </summary>
        /// <param name="yiDunEvent">易盾事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void GetYiDunCaptcha(YiDunEventBuilder.YiDunEvent yiDunEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 获取SDK版本号
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void GetAPIVersion(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 检查是否存在游客账号
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void HasGeneratedGuest(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 设置隐私协议
        /// </summary>
        /// <param name="yiDunEvent">易盾事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void SetPrivacy(YiDunEventBuilder.YiDunEvent yiDunEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 设置默认分享信息
        /// </summary>
        /// <param name="shareEvent">分享事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void SetDefaultShareInfo(ShareEventBuilder.ShareEvent shareEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 分享
        /// </summary>
        /// <param name="shareEvent">分享事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void Share(ShareEventBuilder.ShareEvent shareEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 小游戏-获取营销系统配置的分享信息
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void GetShareInfoFromMarketService(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 小游戏-获取营销系统配置的分享信息
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void GetSharePointInfoFromMarketService(ShareEventBuilder.ShareEvent shareEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 小游戏-获取营销系统配置的交叉导流信息
        /// </summary>
        /// <param name="callback">回调函数</param>
        /// <param name="newCallback">新回调函数</param>
        public virtual void GetAdInfoFromMarketService(Action<string> callback, Action<string> newCallback) => throw new NotImplementedException();

        /// <summary>
        /// 微信小游戏-广点通归因事件上报
        /// </summary>
        /// <param name="txAdSDKReportEvent">广点通上报事件参数</param>
        public virtual void TxAdSDKReport(TxAdSDKReportEventBuilder.TxAdSDKReportEvent txAdSDKReportEvent) => throw new NotImplementedException();

        /// <summary>
        /// 微信小游戏-设置用户信息
        /// </summary>
        /// <param name="setWxUserInfoEvent">微信用户信息事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void SetWxUserInfo(SetWxUserInfoEventBuilder.SetWxUserInfoEvent setWxUserInfoEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 抖音归因设置用户信息
        /// </summary>
        /// <param name="dYTrackEvent">抖音追踪事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void ResetUserInfo(DYTrackEventBuilder.DYTrackEvent dYTrackEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 抖音归因获取用户信息
        /// </summary>
        /// <param name="dYTrackEvent">抖音追踪事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void GetUserInfo(DYTrackEventBuilder.DYTrackEvent dYTrackEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 抖音归因获取直播信息
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void GetLiveInfo(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 单独设置配置参数
        /// </summary>
        /// <param name="configEvent">配置事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void SetConfig(ConfigEventBuilder.ConfigEvent configEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 检查微信是否已安装
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void IsWxInstalled(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 展示AIHelp
        /// </summary>
        /// <param name="aihelpShowType">AIHelp显示参数</param>
        public virtual void ShowAIHelp(AIHelpShowTypeBuilder.AIHelpShowType aihelpShowType) => throw new NotImplementedException();

        /// <summary>
        /// 设置登录用户信息
        /// </summary>
        /// <param name="aihelpSetLoginUserInfoType">AIHelp设置登录用户信息参数</param>
        public virtual void SetLoginUserInfo(AIHelpSetLoginUserInfoTypeBuilder.AIHelpSetLoginUserInfoType aihelpSetLoginUserInfoType) => throw new NotImplementedException();

        /// <summary>
        /// 退出登录
        /// </summary>
        public virtual void LogoutAIHelp() => throw new NotImplementedException();

        /// <summary>
        /// 获取AIHelp未读消息数
        /// </summary>
        public virtual void FetchAIHelpUnreadMessageCount() => throw new NotImplementedException();

        /// <summary>
        /// 注册AIHelp事件监听
        /// </summary>
        public virtual void RegisterAIHelpEventListener(AiHelpEventType aiHelpEventType, Action<string, object> callback) => throw new NotImplementedException();

        /// <summary>
        /// 设置FIrebase崩溃自定义键值对
        /// </summary>
        public virtual void SetFirebaseCrashCustomKey(FirebaseCrashCustomKeyBuilder.FirebaseCrashCustomKeyType firebaseCrashCustomKey) => throw new NotImplementedException();

        /// <summary>
        /// 上报FIrebase崩溃自定义消息
        /// </summary>
        public virtual void ReportFirebaseCrashLog(FirebaseCrashLogBuilder.FirebaseCrashLogType firebaseCrashLog) => throw new NotImplementedException();

        /// <summary>
        /// 设置FIrebase崩溃用户标识符
        /// </summary>
        public virtual void SetFirebaseCrashUserIdentifier(FirebaseCrashUserIdentifierBuilder.FirebaseCrashUserIdentifierType firebaseCrashUserIdentifier) => throw new NotImplementedException();

        /// <summary>
        /// 上报FIrebase崩溃异常
        /// </summary>
        public virtual void ReportFirebaseCrashException(FirebaseCrashExceptionTypeBuilder.FirebaseCrashExceptionType firebaseCrashException) => throw new NotImplementedException();

        /// <summary>
        /// 展示个人清单
        /// </summary>
        public virtual void ShowCollectUserInfo() => throw new NotImplementedException();

        /// <summary>
        /// 展示三方清单
        /// </summary>
        public virtual void ShowCollectThirdInfo() => throw new NotImplementedException();

        /// <summary>
        /// 获取当前包自定义的属性，输入业务定义的key，返回当前包对应的value
        /// </summary>
        public virtual string GetCustomKeyValue(string key, string defaultValue) => throw new NotImplementedException();
        
        /// <summary>
        /// 获取设备的性能等级（0,1,2,3）
        /// </summary>
        public virtual string GetDeviceLevel(Action<string> callback) => throw new NotImplementedException();

        public virtual void CreateGridGamePanel(GridGameModuleBuilder.GridGameModule gridGameModule, Action<string, object> callback) => throw new NotImplementedException();

        internal virtual void ShowGridGamePanel(string panelId) => throw new NotImplementedException();

        internal virtual void HideGridGamePanel(string panelId) => throw new NotImplementedException();
    
        internal virtual void DestroyGridGamePanel(string panelId) => throw new NotImplementedException();

        /// <summary>
        /// 修改邮箱密码
        /// </summary>
        /// <param name="loginEvent">登录事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void UpdatePassword(LoginEventBuilder.LoginEvent loginEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 请求跟踪授权
        /// </summary>
        /// <param name="callback">回调函数</param>
        public virtual void RequestTrackingAuthorization(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 解绑账号
        /// </summary>
        /// <param name="bindEvent">绑定事件参数</param>
        /// <param name="callback">回调函数</param>
        public virtual void UnBind(BindEventBuilder.BindEvent bindEvent, Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 抖音小游戏小额支付专用接口
        /// </summary>
        public virtual void MicroPayment(PayEventBuilder.PayEvent payEvent, Action<string> callback) => throw new NotImplementedException();
        
        /// <summary>
        /// 获取用户风险等级
        /// </summary>
        public virtual void RequestUserRiskRank(Action<string> callback) => throw new NotImplementedException();

        /// <summary>
        /// 微信小游戏调起用户确认收款页面
        /// </summary>
        public virtual void RequestMerchantTransfer(MchTransferBuilder.MchTransferEvent mchTransferEvent, Action<string> callback) => throw new NotImplementedException();


        /// <summary>
        /// 获取商店区域
        /// </summary>
        public virtual void GetStoreRegion(Action<string> callback) => throw new NotImplementedException();
    }

    public static class NativeInterface
    {
        private static ISDKInterface _sdkInterface;

        private static GameObject callbackListener = null;

        static NativeInterface()
        {
            Init();
        }

        private static void Init()
        {
            if (callbackListener == null)
            {
                callbackListener = new GameObject("NativeCallBack");
                callbackListener.AddComponent<NativeCallBack>();
#if UNITY_EDITOR
                _sdkInterface = new EditorInterface();
#elif UNITY_IOS
            _sdkInterface = new IOSInterface();
#elif UNITY_ANDROID
            _sdkInterface = new AndroidInterface();
#elif UNITY_WEBGL
            _sdkInterface = new WebGLInterface();
#endif
                _sdkInterface.Init();
            }
        }
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void InitSDK(Action<string> callback)
        {
            Init();
            _sdkInterface.InitSDK(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void InitSDK(InitEventBuilder.InitEvent initEvent, Action<string> callback)
        {
            Init();
            _sdkInterface.InitSDK(initEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void UpdateServerUrl(string serverUrl)
        {
            _sdkInterface.UpdateServerUrl(serverUrl);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void UpdateServerUrlList(string[] serverUrlList)
        {
            _sdkInterface.UpdateServerUrlList(serverUrlList);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SilentLogin(Action<string> callback)
        {
            _sdkInterface.SilentLogin(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_EDITOR
        public static void SilentLoginWithParam(LoginEventBuilder.LoginEvent loginEvent, Action<string> callback)
        {
            _sdkInterface.SilentLoginWithParam(loginEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void Login(Action<string> callback)
        {
            _sdkInterface.Login(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void LoginByType(LoginEventBuilder.LoginEvent loginEvent, Action<string> callback)
        {
            _sdkInterface.LoginByType(loginEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SendCode(LoginEventBuilder.LoginEvent loginEvent, Action<string> callback)
        {
            _sdkInterface.SendCode(loginEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void Charge(PayEventBuilder.PayEvent payEvent, Action<string> callback)
        {
            _sdkInterface.Charge(payEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void Pay(PayEventBuilder.PayEvent payEvent, Action<string> callback)
        {
            _sdkInterface.Pay(payEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GetLocalProductInfo(Action<string> callback)
        {
            _sdkInterface.GetLocalProductInfo(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR       
        public static void SetPushResultHandler(Action<string> onReceive, Action<string> onClick)
        {
            _sdkInterface.SetPushResultHandler(onReceive, onClick);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void AppsFlyerEventReport(ReportEventBuilder.ReportEvent reportEvent)
        {
            _sdkInterface.AppsFlyerEventReport(reportEvent);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void Logout(Action<string> callback)
        {
            _sdkInterface.Logout(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void LogoutChannel(LoginEventBuilder.LoginEvent logoutEvent, Action<string> callback)
        {
            _sdkInterface.LogoutChannel(logoutEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void ExitGame(Action<string> callback)
        {
            _sdkInterface.ExitGame(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GetAppsFlyerDeviceId(Action<string> callback)
        {
            _sdkInterface.GetAppsFlyerDeviceId(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SetAppsFlyerCommonParam(ReportEventBuilder.ReportEvent reportEvent)
        {
            Init();
            _sdkInterface.SetAppsFlyerCommonParam(reportEvent);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SetFirebaseUserProperty(ReportEventBuilder.ReportEvent reportEvent)
        {
            _sdkInterface.SetFirebaseUserProperty(reportEvent);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SetFirebaseCommonParam(ReportEventBuilder.ReportEvent reportEvent)
        {
            Init();
            _sdkInterface.SetFirebaseCommonParam(reportEvent);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void FirebaseEventReport(ReportEventBuilder.ReportEvent reportEvent)
        {
            _sdkInterface.FirebaseEventReport(reportEvent);
        }
#endif
#if UNITY_IOS || UNITY_EDITOR
        public static void SetGDTCommonParam(ReportEventBuilder.ReportEvent reportEvent)
        {
            _sdkInterface.SetGDTCommonParam(reportEvent);
        }
#endif
#if UNITY_IOS || UNITY_EDITOR
        public static void GDTEventReport(ReportEventBuilder.ReportEvent reportEvent)
        {
            _sdkInterface.GDTEventReport(reportEvent);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void Check(BindEventBuilder.BindEvent bindEvent, Action<string> callback)
        {
            _sdkInterface.Check(bindEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void Bind(BindEventBuilder.BindEvent bindEvent, Action<string> callback)
        {
            _sdkInterface.Bind(bindEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR   
        public static void CanBindList(Action<string> callback)
        {
            _sdkInterface.CanBindList(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void AlreadyBindList(Action<string> callback)
        {
            _sdkInterface.AlreadyBindList(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GetBindUserList(BindEventBuilder.BindEvent bindEvent, Action<string> callback)
        {
            _sdkInterface.GetBindUserList(bindEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GAProfileTrack(ReportEventBuilder.ReportEvent reportEvent)
        {
            _sdkInterface.GAProfileTrack(reportEvent);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GAEventTrack(ReportEventBuilder.ReportEvent reportEvent)
        {
            Init();
            _sdkInterface.GAEventTrack(reportEvent);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SetGACommonParam(ReportEventBuilder.ReportEvent reportEvent)
        {
            _sdkInterface.SetGACommonParam(reportEvent);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SetLocalDeliverListener(Action<string, Action, Action<string, string>> callback)
        {
            Init();
            _sdkInterface.SetLocalDeliverListener(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void RequestNotificationPermission()
        {
            _sdkInterface.RequestNotificationPermission();
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SetCertificationListener(Action<string> callback)
        {
            _sdkInterface.SetCertificationListener(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void Certificate(CertificationEventBuilder.CertificationEvent certificationEvent, Action<string> callback)
        {
            _sdkInterface.Certificate(certificationEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static string GetCertificationInfo()
        {
            return _sdkInterface.GetCertificationInfo();
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void ReCertificate(CertificationEventBuilder.CertificationEvent certificationEvent, Action<string> callback)
        {
            _sdkInterface.ReCertificate(certificationEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void RefreshCertification()
        {
            _sdkInterface.RefreshCertification();
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static bool IsCertificationEnable()
        {
            return _sdkInterface.IsCertificationEnable();
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SetServerLanguage(string serverLanguage, Action<string> callback)
        {
            _sdkInterface.SetServerLanguage(serverLanguage, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GetDeviceId(Action<string> callback)
        {
            _sdkInterface.GetDeviceId(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void LiveDetect(YiDunEventBuilder.YiDunEvent yiDunEvent, Action<string> callback)
        {
            _sdkInterface.LiveDetect(yiDunEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void RequestWXAuthorize(Action<string> callback)
        {
            _sdkInterface.RequestWXAuthorize(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GetWXAuthInfo(Action<string> callback)
        {
            _sdkInterface.GetWXAuthInfo(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GetYiDunCaptcha(YiDunEventBuilder.YiDunEvent yiDunEvent, Action<string> callback)
        {
            _sdkInterface.GetYiDunCaptcha(yiDunEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GetAPIVersion(Action<string> callback)
        {
            _sdkInterface.GetAPIVersion(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void HasGeneratedGuest(Action<string> callback)
        {
            _sdkInterface.HasGeneratedGuest(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SetPrivacy(YiDunEventBuilder.YiDunEvent yiDunEvent, Action<string> callback)
        {
            _sdkInterface.SetPrivacy(yiDunEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SetDefaultShareInfo(ShareEventBuilder.ShareEvent shareEvent, Action<string> callback)
        {
            _sdkInterface.SetDefaultShareInfo(shareEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR   
        public static void Share(ShareEventBuilder.ShareEvent shareEvent, Action<string> callback)
        {
            _sdkInterface.Share(shareEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GetShareInfoFromMarketService(Action<string> callback)
        {
            _sdkInterface.GetShareInfoFromMarketService(callback);
        }
#endif
#if UNITY_WEBGL || UNITY_EDITOR
        public static void GetSharePointInfoFromMarketService(ShareEventBuilder.ShareEvent shareEvent, Action<string> callback)
        {
            _sdkInterface.GetSharePointInfoFromMarketService(shareEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GetAdInfoFromMarketService(Action<string> callback, Action<string> newCallback)
        {
            _sdkInterface.GetAdInfoFromMarketService(callback, newCallback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void TxAdSDKReport(TxAdSDKReportEventBuilder.TxAdSDKReportEvent txAdSDKReportEvent)
        {
            _sdkInterface.TxAdSDKReport(txAdSDKReportEvent);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void setWxUserInfo(SetWxUserInfoEventBuilder.SetWxUserInfoEvent setWxUserInfoEvent, Action<string> callback)
        {
            _sdkInterface.SetWxUserInfo(setWxUserInfoEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void ResetUserInfo(DYTrackEventBuilder.DYTrackEvent dYTrackEvent, Action<string> callback)
        {
            _sdkInterface.ResetUserInfo(dYTrackEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GetUserInfo(DYTrackEventBuilder.DYTrackEvent dYTrackEvent, Action<string> callback)
        {
            _sdkInterface.GetUserInfo(dYTrackEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void GetLiveInfo(Action<string> callback)
        {
            _sdkInterface.GetLiveInfo(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SetConfig(ConfigEventBuilder.ConfigEvent configEvent, Action<string> callback)
        {
            _sdkInterface.SetConfig(configEvent, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void IsWxInstalled(Action<string> callback)
        {
            _sdkInterface.IsWxInstalled(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void ShowAIHelp(AIHelpShowTypeBuilder.AIHelpShowType aihelpShowType)
        {
            _sdkInterface.ShowAIHelp(aihelpShowType);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void SetLoginUserInfo(AIHelpSetLoginUserInfoTypeBuilder.AIHelpSetLoginUserInfoType aihelpSetLoginUserInfoType)
        {
            _sdkInterface.SetLoginUserInfo(aihelpSetLoginUserInfoType);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR   
        public static void LogoutAIHelp()
        {
            _sdkInterface.LogoutAIHelp();
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR   
        public static void FetchAIHelpUnreadMessageCount()
        {
            _sdkInterface.FetchAIHelpUnreadMessageCount();
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR   
        public static void RegisterAIHelpEventListener(AiHelpEventType aiHelpEventType, Action<string, object> callback)
        {
            _sdkInterface.RegisterAIHelpEventListener(aiHelpEventType, callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR   
        public static void SetFirebaseCrashCustomKey(FirebaseCrashCustomKeyBuilder.FirebaseCrashCustomKeyType firebaseCrashCustomKey)
        {
            _sdkInterface.SetFirebaseCrashCustomKey(firebaseCrashCustomKey);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR   
        public static void ReportFirebaseCrashLog(FirebaseCrashLogBuilder.FirebaseCrashLogType firebaseCrashLog)
        {
            _sdkInterface.ReportFirebaseCrashLog(firebaseCrashLog);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR   
        public static void SetFirebaseCrashUserIdentifier(FirebaseCrashUserIdentifierBuilder.FirebaseCrashUserIdentifierType firebaseCrashUserIdentifier)
        {
            _sdkInterface.SetFirebaseCrashUserIdentifier(firebaseCrashUserIdentifier);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR   
        public static void ReportFirebaseCrashException(FirebaseCrashExceptionTypeBuilder.FirebaseCrashExceptionType firebaseCrashException)
        {
            _sdkInterface.ReportFirebaseCrashException(firebaseCrashException);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR   
        public static void ShowCollectUserInfo()
        {
            _sdkInterface.ShowCollectUserInfo();
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR   
        public static void ShowCollectThirdInfo()
        {
            _sdkInterface.ShowCollectThirdInfo();
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR       
        public static string GetCustomKeyValue(string key, string defaultValue)
        {
            return _sdkInterface.GetCustomKeyValue(key, defaultValue);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR       
        public static string GetDeviceLevel(Action<string> callback)
        {
            return _sdkInterface.GetDeviceLevel(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void CreateGridGamePanel(GridGameModuleBuilder.GridGameModule gridGameModule, Action<string, object> callback)
        {
            _sdkInterface.CreateGridGamePanel(gridGameModule, callback);
        }
#endif

#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        internal static void ShowGridGamePanel(string panelId)
        {
            _sdkInterface.ShowGridGamePanel(panelId);
        }
#endif

#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        internal static void HideGridGamePanel(string panelId)
        {
            _sdkInterface.HideGridGamePanel(panelId);
        }
#endif

#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        internal static void DestroyGridGamePanel(string panelId)
        {
            _sdkInterface.DestroyGridGamePanel(panelId);
        }
#endif

#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void UpdatePassword(LoginEventBuilder.LoginEvent loginEvent, Action<string> callback)
        {
            _sdkInterface.UpdatePassword(loginEvent, callback);
        }
#endif

#if UNITY_IOS || UNITY_EDITOR
        public static void RequestTrackingAuthorization(Action<string> callback)
        {
            _sdkInterface.RequestTrackingAuthorization(callback);
        }
#endif
#if UNITY_ANDROID || UNITY_IOS || UNITY_WEBGL || UNITY_EDITOR
        public static void UnBind(BindEventBuilder.BindEvent bindEvent, Action<string> callback)
        {
            _sdkInterface.UnBind(bindEvent, callback);
        }
#endif

#if UNITY_WEBGL || UNITY_EDITOR
        public static void MicroPayment(PayEventBuilder.PayEvent payEvent, Action<string> callback)
        {
            _sdkInterface.MicroPayment(payEvent, callback);
        }
#endif

#if UNITY_WEBGL || UNITY_EDITOR
        public static void RequestUserRiskRank(Action<string> callback)
        {
            _sdkInterface.RequestUserRiskRank(callback);
        }
#endif

#if UNITY_WEBGL || UNITY_EDITOR
        public static void RequestMerchantTransfer(MchTransferBuilder.MchTransferEvent mchTransferEvent, Action<string> callback)
        {
            _sdkInterface.RequestMerchantTransfer(mchTransferEvent, callback);
        }
#endif

#if UNITY_ANDROID || UNITY_EDITOR
        public static void GetStoreRegion(Action<string> callback)
        {
            _sdkInterface.GetStoreRegion(callback);
        }
#endif
    }
}