fix: 修复 Notification 授权在 iOS 上自动触发的 BUG。
Signed-off-by: huyufei <yufei.hu@castbox.fm>dev
parent
ef547caba9
commit
50c5627ac2
|
|
@ -235,7 +235,6 @@ namespace Guru
|
||||||
{ "type", type }
|
{ "type", type }
|
||||||
};
|
};
|
||||||
if(!string.IsNullOrEmpty(scene)) dict[ParameterItemName] = scene;
|
if(!string.IsNullOrEmpty(scene)) dict[ParameterItemName] = scene;
|
||||||
LogEvent(EventATTResult, dict);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
|
|
@ -207,12 +207,12 @@ namespace Guru
|
||||||
private static void SetATTStatus()
|
private static void SetATTStatus()
|
||||||
{
|
{
|
||||||
string status = ATTManager.GetStatus();
|
string status = ATTManager.GetStatus();
|
||||||
GuruAnalytics.SetUserProperty(ParameterATTStatus, status);
|
GuruAnalytics.Instance.SetUserProperty(ParameterATTStatus, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetIDFV()
|
private static void SetIDFV()
|
||||||
{
|
{
|
||||||
GuruAnalytics.SetIDFV(DeviceIDHelper.IDFV);
|
GuruAnalytics.Instance.SetIDFV(DeviceIDHelper.IDFV);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SetIDFA()
|
private static void SetIDFA()
|
||||||
|
|
@ -228,7 +228,7 @@ namespace Guru
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(IPMConfig.ADJUST_IDFA))
|
if (!string.IsNullOrEmpty(IPMConfig.ADJUST_IDFA))
|
||||||
{
|
{
|
||||||
GuruAnalytics.SetIDFA(IPMConfig.ADJUST_IDFA);
|
GuruAnalytics.Instance.SetIDFA(IPMConfig.ADJUST_IDFA);
|
||||||
_hasGotIDFA = true;
|
_hasGotIDFA = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,14 +8,31 @@ namespace Guru
|
||||||
public static partial class FirebaseUtil
|
public static partial class FirebaseUtil
|
||||||
{
|
{
|
||||||
private static int _messageRetry = 5;
|
private static int _messageRetry = 5;
|
||||||
public static bool? IsInitMessage;
|
// public static bool? IsInitMessage;
|
||||||
|
private static bool _isAutoFetchFcmToken = true;
|
||||||
|
private static bool _isFetchOnce = false;
|
||||||
|
|
||||||
|
public static void SetAutoFetchFcmToken(bool value)
|
||||||
|
{
|
||||||
|
_isAutoFetchFcmToken = value;
|
||||||
|
}
|
||||||
|
|
||||||
public static void InitializeMessage()
|
public static void InitializeMessage()
|
||||||
{
|
{
|
||||||
|
if (_isAutoFetchFcmToken)
|
||||||
|
{
|
||||||
|
StartFetchFcmToken();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void StartFetchFcmToken()
|
||||||
|
{
|
||||||
|
if (_isFetchOnce) return;
|
||||||
|
_isFetchOnce = true;
|
||||||
|
|
||||||
FirebaseMessaging.TokenReceived += OnTokenReceived;
|
FirebaseMessaging.TokenReceived += OnTokenReceived;
|
||||||
FirebaseMessaging.MessageReceived += OnMessageReceived;
|
FirebaseMessaging.MessageReceived += OnMessageReceived;
|
||||||
GetFCMToken();
|
GetFCMToken();
|
||||||
IsInitMessage = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void GetFCMToken()
|
private static void GetFCMToken()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue