Compare commits
No commits in common. "1e59e5efa6a484071c143fe17856c5ad74163344" and "b9291e78850e70ab98401ff2157269fc94dec244" have entirely different histories.
1e59e5efa6
...
b9291e7885
|
|
@ -278,8 +278,6 @@ namespace Guru
|
||||||
/// <param name="callback"></param>
|
/// <param name="callback"></param>
|
||||||
public static void RequestNotificationPermission(Action<string> callback = null)
|
public static void RequestNotificationPermission(Action<string> callback = null)
|
||||||
{
|
{
|
||||||
FirebaseUtil.StartFetchFcmToken();
|
|
||||||
|
|
||||||
UnityEngine.Debug.Log($"[SDK] ---- RequestNotificationPermission");
|
UnityEngine.Debug.Log($"[SDK] ---- RequestNotificationPermission");
|
||||||
NotificationService.RequestPermission(status =>
|
NotificationService.RequestPermission(status =>
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,8 @@ namespace Guru
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region Android System
|
#region Android System
|
||||||
|
|
||||||
#if UNITY_ANDROID
|
#if UNITY_ANDROID
|
||||||
|
|
@ -77,5 +78,7 @@ namespace Guru
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -6,7 +6,6 @@ namespace Guru
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Debug = UnityEngine.Debug;
|
using Debug = UnityEngine.Debug;
|
||||||
using Guru.Network;
|
|
||||||
|
|
||||||
public partial class GuruSDK: MonoBehaviour
|
public partial class GuruSDK: MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
@ -148,15 +147,11 @@ namespace Guru
|
||||||
_isDebugEnabled = config.DebugMode;
|
_isDebugEnabled = config.DebugMode;
|
||||||
|
|
||||||
if (config.EnableDebugLogEvent) Analytics.EnableDebugAnalytics = true; // 允许 Debug 模式下打点
|
if (config.EnableDebugLogEvent) Analytics.EnableDebugAnalytics = true; // 允许 Debug 模式下打点
|
||||||
if (!config.AutoNotificationPermission) FirebaseUtil.SetAutoFetchFcmToken(false); // 不允许自动启动获取 FCM Token
|
|
||||||
|
|
||||||
InitUpdaters(); // Updaters
|
InitUpdaters(); // Updaters
|
||||||
InitThreadHandler(); // 初始化线程处理器
|
InitThreadHandler(); // 初始化线程处理器
|
||||||
InitServices();
|
InitServices();
|
||||||
|
|
||||||
InitNetworkMonitor(); // 网络状态
|
|
||||||
|
|
||||||
|
|
||||||
onComplete?.Invoke(true);
|
onComplete?.Invoke(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -788,34 +783,6 @@ namespace Guru
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region 网络状态上报
|
|
||||||
|
|
||||||
|
|
||||||
private NetworkStatusMonitor _networkStatusMonitor;
|
|
||||||
|
|
||||||
private void InitNetworkMonitor()
|
|
||||||
{
|
|
||||||
_networkStatusMonitor = new NetworkStatusMonitor();
|
|
||||||
_networkStatusMonitor.Init(OnNetworkMonitorInitComplete);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void OnNetworkMonitorInitComplete(bool success)
|
|
||||||
{
|
|
||||||
if (success)
|
|
||||||
{
|
|
||||||
// 上报用户network属性
|
|
||||||
var status = _networkStatusMonitor.GetNetworkStatus();
|
|
||||||
SetUserProperty("network", status);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Debug.LogError($"[SDK] --- NetworkStatusMonitor init failed");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue