update: 更新 Banner 背景, 更新 Firebase 回调
parent
97d472beaa
commit
e4ce0fb408
|
|
@ -268,6 +268,15 @@ namespace Guru
|
|||
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)
|
||||
{
|
||||
// Analytics.ADBadsLoaded(adUnitId, GetAdsLoadDuration(ref _badsloadStartTime), _badsCategory);
|
||||
|
|
|
|||
|
|
@ -15,15 +15,17 @@ namespace Guru
|
|||
//FirebaseAuth获取用户验证并同步用户数据
|
||||
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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
CoroutineHelper.Instance.StartDelayed(_wait, AuthUser);
|
||||
OnFirebaseAuthResult?.Invoke(false);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -34,10 +36,12 @@ namespace Guru
|
|||
{
|
||||
Log.E(LOG_TAG,"[Auth] SignInWithCustomTokenAsync encountered an error: " + task.Exception);
|
||||
CoroutineHelper.Instance.StartDelayed(_wait, AuthUser);
|
||||
OnFirebaseAuthResult?.Invoke(false);
|
||||
}
|
||||
else if (CurrentUser == null)
|
||||
{
|
||||
CoroutineHelper.Instance.StartDelayed(_wait, AuthUser);
|
||||
OnFirebaseAuthResult?.Invoke(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,6 +16,11 @@ namespace Guru
|
|||
public static DependencyStatus DependencyStatus = DependencyStatus.UnavailableOther;
|
||||
public static bool IsFirebaseInitialized => DependencyStatus == DependencyStatus.Available;
|
||||
public static Action<bool> onInitComplete;
|
||||
|
||||
public static Action<bool> OnFirebaseAuthResult;
|
||||
public static Action<bool> OnUserAuthResult;
|
||||
|
||||
|
||||
|
||||
public static void InitFirebase(Action callback, bool isDebug = false)
|
||||
{
|
||||
|
|
@ -53,8 +58,12 @@ namespace Guru
|
|||
.SetRetryTimes(-1)
|
||||
.SetSuccessCallBack(() =>
|
||||
{
|
||||
OnUserAuthResult?.Invoke(true);
|
||||
InitializeMessage();
|
||||
AuthUser();
|
||||
}).SetFailCallBack(() =>
|
||||
{
|
||||
OnUserAuthResult?.Invoke(false);
|
||||
})
|
||||
.Send();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue