update: 更新 Banner 背景, 更新 Firebase 回调
parent
97d472beaa
commit
e4ce0fb408
|
|
@ -268,6 +268,15 @@ namespace Guru
|
||||||
MaxSdk.HideBanner(GetBannerID());
|
MaxSdk.HideBanner(GetBannerID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 设置 Banner 背景颜色
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="color"></param>
|
||||||
|
public virtual void SetBannerBackgroundColor(Color color)
|
||||||
|
{
|
||||||
|
_backColor = color;
|
||||||
|
}
|
||||||
|
|
||||||
private void OnBannerLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
private void OnBannerLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||||
{
|
{
|
||||||
// Analytics.ADBadsLoaded(adUnitId, GetAdsLoadDuration(ref _badsloadStartTime), _badsCategory);
|
// Analytics.ADBadsLoaded(adUnitId, GetAdsLoadDuration(ref _badsloadStartTime), _badsCategory);
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,17 @@ namespace Guru
|
||||||
//FirebaseAuth获取用户验证并同步用户数据
|
//FirebaseAuth获取用户验证并同步用户数据
|
||||||
if (CurrentUser != null)
|
if (CurrentUser != null)
|
||||||
{
|
{
|
||||||
Log.I(LOG_TAG, "[Auth]之前验证没过期,CurrentUser: " + CurrentUser.UserId);
|
Log.I(LOG_TAG, $"[Auth] user exists,UserId:{CurrentUser.UserId}");
|
||||||
|
OnFirebaseAuthResult?.Invoke(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
string authToken = IPMConfig.IPM_FIREBASE_TOKEN;
|
string authToken = IPMConfig.IPM_FIREBASE_TOKEN;
|
||||||
Log.I(LOG_TAG, $"[Auth]AuthToken:{authToken}");
|
Log.I(LOG_TAG, $"[Auth] Firebase Token:{authToken}");
|
||||||
if (string.IsNullOrEmpty(authToken) || !NetworkUtil.IsNetAvaliable)
|
if (string.IsNullOrEmpty(authToken) || !NetworkUtil.IsNetAvaliable)
|
||||||
{
|
{
|
||||||
CoroutineHelper.Instance.StartDelayed(_wait, AuthUser);
|
CoroutineHelper.Instance.StartDelayed(_wait, AuthUser);
|
||||||
|
OnFirebaseAuthResult?.Invoke(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,10 +36,12 @@ namespace Guru
|
||||||
{
|
{
|
||||||
Log.E(LOG_TAG,"[Auth] SignInWithCustomTokenAsync encountered an error: " + task.Exception);
|
Log.E(LOG_TAG,"[Auth] SignInWithCustomTokenAsync encountered an error: " + task.Exception);
|
||||||
CoroutineHelper.Instance.StartDelayed(_wait, AuthUser);
|
CoroutineHelper.Instance.StartDelayed(_wait, AuthUser);
|
||||||
|
OnFirebaseAuthResult?.Invoke(false);
|
||||||
}
|
}
|
||||||
else if (CurrentUser == null)
|
else if (CurrentUser == null)
|
||||||
{
|
{
|
||||||
CoroutineHelper.Instance.StartDelayed(_wait, AuthUser);
|
CoroutineHelper.Instance.StartDelayed(_wait, AuthUser);
|
||||||
|
OnFirebaseAuthResult?.Invoke(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@ namespace Guru
|
||||||
public static bool IsFirebaseInitialized => DependencyStatus == DependencyStatus.Available;
|
public static bool IsFirebaseInitialized => DependencyStatus == DependencyStatus.Available;
|
||||||
public static Action<bool> onInitComplete;
|
public static Action<bool> onInitComplete;
|
||||||
|
|
||||||
|
public static Action<bool> OnFirebaseAuthResult;
|
||||||
|
public static Action<bool> OnUserAuthResult;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void InitFirebase(Action callback, bool isDebug = false)
|
public static void InitFirebase(Action callback, bool isDebug = false)
|
||||||
{
|
{
|
||||||
_isReady = false;
|
_isReady = false;
|
||||||
|
|
@ -53,8 +58,12 @@ namespace Guru
|
||||||
.SetRetryTimes(-1)
|
.SetRetryTimes(-1)
|
||||||
.SetSuccessCallBack(() =>
|
.SetSuccessCallBack(() =>
|
||||||
{
|
{
|
||||||
|
OnUserAuthResult?.Invoke(true);
|
||||||
InitializeMessage();
|
InitializeMessage();
|
||||||
AuthUser();
|
AuthUser();
|
||||||
|
}).SetFailCallBack(() =>
|
||||||
|
{
|
||||||
|
OnUserAuthResult?.Invoke(false);
|
||||||
})
|
})
|
||||||
.Send();
|
.Send();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue