public static int SendCustom(NotificationParams notificationParams)
        {
            long   num  = (long)notificationParams.Delay.TotalMilliseconds;
            long   num2 = (!notificationParams.Repeat) ? 0L : ((long)notificationParams.RepeatInterval.TotalMilliseconds);
            string text = string.Join(",", (from i in notificationParams.Vibration
                                            select i.ToString()).ToArray <string>());

            new AndroidJavaClass("com.hippogames.simpleandroidnotifications.Controller").CallStatic("SetNotification", new object[]
            {
                notificationParams.Id,
                notificationParams.GroupName ?? string.Empty,
                notificationParams.GroupSummary ?? string.Empty,
                notificationParams.ChannelId,
                notificationParams.ChannelName,
                num,
                Convert.ToInt32(notificationParams.Repeat),
                num2,
                notificationParams.Title,
                notificationParams.Message,
                notificationParams.Ticker,
                Convert.ToInt32(notificationParams.Multiline),
                Convert.ToInt32(notificationParams.Sound),
                notificationParams.CustomSound ?? string.Empty,
                Convert.ToInt32(notificationParams.Vibrate),
                text,
                Convert.ToInt32(notificationParams.Light),
                notificationParams.LightOnMs,
                notificationParams.LightOffMs,
                NotificationManager.ColotToInt(notificationParams.LightColor),
                notificationParams.LargeIcon ?? string.Empty,
                NotificationManager.GetSmallIconName(notificationParams.SmallIcon),
                NotificationManager.ColotToInt(notificationParams.SmallIconColor),
                (int)notificationParams.ExecuteMode,
                (int)notificationParams.Importance,
                notificationParams.CallbackData,
                "com.google.firebase.MessagingUnityPlayerActivity"
            });
            NotificationIdHandler.AddScheduledNotificaion(notificationParams.Id);
            return(notificationParams.Id);
        }
예제 #2
0
        public static int SendCustom(NotificationParams notificationParams)
        {
            NotificationParams notificationParam = notificationParams;
            long   totalMilliseconds             = (long)notificationParam.Delay.TotalMilliseconds;
            long   num = (!notificationParam.Repeat ? (long)0 : (long)notificationParam.RepeatInterval.TotalMilliseconds);
            string str = string.Join(",", (
                                         from i in (IEnumerable <int>)notificationParam.Vibration
                                         select i.ToString()).ToArray <string>());

            (new AndroidJavaClass("com.hippogames.simpleandroidnotifications.Controller")).CallStatic("SetNotification", new object[] { notificationParam.Id, notificationParam.GroupName ?? string.Empty, notificationParam.GroupSummary ?? string.Empty, notificationParam.ChannelId, notificationParam.ChannelName, totalMilliseconds, Convert.ToInt32(notificationParam.Repeat), num, notificationParam.Title, notificationParam.Message, notificationParam.Ticker, Convert.ToInt32(notificationParam.Multiline), Convert.ToInt32(notificationParam.Sound), notificationParam.CustomSound ?? string.Empty, Convert.ToInt32(notificationParam.Vibrate), str, Convert.ToInt32(notificationParam.Light), notificationParam.LightOnMs, notificationParam.LightOffMs, NotificationManager.ColotToInt(notificationParam.LightColor), notificationParam.LargeIcon ?? string.Empty, NotificationManager.GetSmallIconName(notificationParam.SmallIcon), NotificationManager.ColotToInt(notificationParam.SmallIconColor), (int)notificationParam.ExecuteMode, notificationParam.CallbackData, "com.blizzard.wowcompanion.CompanionNativeActivity" });
            NotificationIdHandler.AddScheduledNotificaion(notificationParam.Id);
            return(notificationParams.Id);
        }