parent
b6e038a027
commit
dbb56e5a32
|
|
@ -1,6 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "Guru.Editor",
|
"name": "Guru.Editor",
|
||||||
"rootNamespace": "",
|
|
||||||
"references": [
|
"references": [
|
||||||
"Guru.Runtime",
|
"Guru.Runtime",
|
||||||
"Guru.Notification"
|
"Guru.Notification"
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ namespace Guru.Notification
|
||||||
|
|
||||||
private bool _initOnce = false;
|
private bool _initOnce = false;
|
||||||
private string _notiStatus;
|
private string _notiStatus;
|
||||||
private bool _isPluginReady = false;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化
|
/// 初始化
|
||||||
|
|
@ -91,14 +90,8 @@ namespace Guru.Notification
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void InitPlugins()
|
private void InitPlugins()
|
||||||
{
|
{
|
||||||
_isPluginReady = AndroidNotificationCenter.Initialize();
|
AndroidNotificationCenter.Initialize();
|
||||||
|
Debug.Log($"[Noti][AND] --- Notification Service InitPlugins");
|
||||||
if (!_isPluginReady)
|
|
||||||
{
|
|
||||||
Debug.LogError($"[Noti][AND] --- AndroidNotificationCenter init failed!");
|
|
||||||
// TODO: 处理初始化失败的情况
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
UpdateNotiStatus();
|
UpdateNotiStatus();
|
||||||
}
|
}
|
||||||
|
|
@ -108,8 +101,6 @@ namespace Guru.Notification
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void UpdateNotiStatus()
|
private void UpdateNotiStatus()
|
||||||
{
|
{
|
||||||
if (!_isPluginReady) return;
|
|
||||||
|
|
||||||
TryExecute(() =>
|
TryExecute(() =>
|
||||||
{
|
{
|
||||||
_permissionStatus = AndroidNotificationCenter.UserPermissionToPost;
|
_permissionStatus = AndroidNotificationCenter.UserPermissionToPost;
|
||||||
|
|
@ -122,6 +113,7 @@ namespace Guru.Notification
|
||||||
_notiStatus = STATUS_DENIDED;
|
_notiStatus = STATUS_DENIDED;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Debug.LogWarning($"[SDK][AND] --- UpdateNotiStatus:{_notiStatus} | UserPermissionToPost:{_permissionStatus}");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,8 +122,6 @@ namespace Guru.Notification
|
||||||
private PermissionCallbacks _permissionCallbacks;
|
private PermissionCallbacks _permissionCallbacks;
|
||||||
private void RequestAndroidPermission(Action<string> callback = null)
|
private void RequestAndroidPermission(Action<string> callback = null)
|
||||||
{
|
{
|
||||||
if (!_isPluginReady) return;
|
|
||||||
|
|
||||||
_onPermissionCallback = callback;
|
_onPermissionCallback = callback;
|
||||||
UpdateNotiStatus();
|
UpdateNotiStatus();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue