Skip to content

Commit beee69b

Browse files
committed
Capture API level during initialization
1 parent 0997339 commit beee69b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ public class AndroidNotificationCenter
547547

548548
private static AndroidJavaObject s_CurrentActivity;
549549
private static JniApi s_Jni;
550+
private static int s_ApiLevel;
550551
private static bool s_Initialized = false;
551552

552553
/// <summary>
@@ -575,6 +576,9 @@ public static bool Initialize()
575576
var notificationManager = notificationManagerClass.CallStatic<AndroidJavaObject>("getNotificationManagerImpl", s_CurrentActivity, new NotificationCallback());
576577
s_Jni = new JniApi(notificationManagerClass, notificationManager);
577578

579+
using (var version = new AndroidJavaClass("android/os/Build$VERSION"))
580+
s_ApiLevel = version.GetStatic<int>("SDK_INT");
581+
578582
s_Initialized = true;
579583
#endif
580584
return s_Initialized;

0 commit comments

Comments
 (0)