Skip to content

Commit 82dd883

Browse files
committed
Add new overload for sending using builder that gives the id back
1 parent 1b025ab commit 82dd883

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,18 @@ public static void SendNotification(AndroidJavaObject notificationBuilder)
716716
s_Jni.NotificationManager.ScheduleNotification(notificationBuilder);
717717
}
718718

719+
/// <summary>
720+
/// Schedule a notification created using the provided Notification.Builder object.
721+
/// Notification builder should be created by calling CreateNotificationBuilder.
722+
/// Stores the notification id to the second argument
723+
/// </summary>
724+
public static void SendNotification(AndroidJavaObject notificationBuilder, out int id)
725+
{
726+
id = -1;
727+
if (Initialize())
728+
id = s_Jni.NotificationManager.ScheduleNotification(notificationBuilder);
729+
}
730+
719731
/// <summary>
720732
/// Update an already scheduled notification.
721733
/// If a notification with the specified id was already scheduled it will be overridden with the information from the passed notification struct.

0 commit comments

Comments
 (0)