Skip to content

Commit 99cd1a5

Browse files
authored
Merge pull request #187 from Unity-Technologies/android/jni-refactor-and-optimization
Android/jni refactor and optimization
2 parents dd4c212 + 0ed69a1 commit 99cd1a5

File tree

3 files changed

+579
-124
lines changed

3 files changed

+579
-124
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using UnityEngine;
23

34
namespace Unity.Notifications.Android
@@ -8,6 +9,17 @@ public NotificationCallback() : base("com.unity.androidnotifications.Notificatio
89
{
910
}
1011

12+
public override AndroidJavaObject Invoke(string methodName, AndroidJavaObject[] args)
13+
{
14+
if (methodName.Equals("onSentNotification", StringComparison.InvariantCulture) && args != null && args.Length == 1)
15+
{
16+
onSentNotification(args[0]);
17+
return null;
18+
}
19+
20+
return base.Invoke(methodName, args);
21+
}
22+
1123
public void onSentNotification(AndroidJavaObject notification)
1224
{
1325
AndroidReceivedNotificationMainThreadDispatcher.GetInstance().EnqueueReceivedNotification(notification);

0 commit comments

Comments
 (0)