Skip to content

Commit c5e01ed

Browse files
committed
Do not generate id on C# side
1 parent 82dd883 commit c5e01ed

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

com.unity.mobile.notifications/Runtime/Android/AndroidNotificationCenter.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -680,12 +680,9 @@ public static int SendNotification(AndroidNotification notification, string chan
680680
if (!Initialize())
681681
return -1;
682682

683-
// Now.ToString("yyMMddHHmmssffffff"), but avoiding any culture-related formatting or dependencies
684-
var now = DateTime.UtcNow;
685-
var nowFormatted = $"{now.Year}{now.Month}{now.Day}{now.Hour}{now.Minute}{now.Second}{now.Millisecond}";
686-
int id = Math.Abs(nowFormatted.GetHashCode()) + (new System.Random().Next(10000));
687-
using (var builder = CreateNotificationBuilder(id, notification, channelId))
688-
SendNotification(builder);
683+
int id;
684+
using (var builder = CreateNotificationBuilder(notification, channelId))
685+
SendNotification(builder, out id);
689686

690687
return id;
691688
}

0 commit comments

Comments
 (0)