private static void DoCreateChannel(string id, string title, string description, NotificationImportance importance = NotificationImportance.HIGH, bool enableLights = true, bool enableVibration = true, string soundFileName = null, NotificationSoundContentType contentType = NotificationSoundContentType.UNKNOWN) { if (Application.platform != RuntimePlatform.Android) { UnityEngine.Debug.LogWarning("Local notifications plugin can only be used when running on the Android platform"); return; } AndroidJavaClass androidJavaClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); AndroidJavaObject @static = androidJavaClass.GetStatic <AndroidJavaObject>("currentActivity"); AndroidJavaClass androidJavaClass2 = new AndroidJavaClass("com.partagames.unity.plugins.notification.NotificationUtil"); androidJavaClass2.CallStatic("createChannel", @static, id, title, description, (int)importance, enableLights, enableVibration, soundFileName, (int)contentType); }
public static void CreateChannel(string id, string title, string description, NotificationImportance importance, bool enableLights, bool enableVibration, string soundFileName, NotificationSoundContentType contentType) { DoCreateChannel(id, title, description, importance, enableLights, enableVibration, soundFileName, contentType); }