GuruSDKService/Runtime/GuruSDKService.cs

40 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using Guru;
namespace GuruSDKService
{
public partial class GuruSDKService : Singleton<GuruSDKService>
{
private bool _initService;
private IGuruSDKServiceImp _serviceImp;
public void InitService(IGuruSDKServiceImp serviceImp, Action onFirebaseReady)
{
if(_initService) return;
_initService = true;
_serviceImp = serviceImp;
_onFirebaseReady = onFirebaseReady;
InitSDKModel();
AddCallbackListener();
AddIAPCallbackListener();
Guru.Analytics.EnableTch02Event = true;
GuruSDKInitConfig config = new GuruSDKInitConfig
{
UseCustomConsent = false,
AutoLoadWhenAdsReady = true,
AutoRecordFinishedLevels = true,
IsBuyNoAds = _serviceImp.IsNoAD,
CustomServiceKey = _serviceImp.CustomServiceKey,
BannerBackgroundColor = _serviceImp.BannerBackgroundColor,
IAPEnabled = _serviceImp.IsIAPEnabled,
DebugMode = _serviceImp.IsDebugMode,
DefaultRemoteData = _serviceImp.GetDefaultRemoteData(),
GoogleKeys = _serviceImp.GetGooglePlayTangleData(),
AppleRootCerts = _serviceImp.GetAppleTangleData()
};
GuruSDK.Init(config, null);
}
}
}