@@ -59,7 +59,7 @@ public async Task ClearAllNotificationsAsync() {
59
59
}
60
60
61
61
public void Initialize ( ) {
62
- _notifications . Call ( "addPermissionChangedHandler" , new IPermissionChangedHandler ( this ) ) ; // Notifications.PermissionChanged
62
+ _notifications . Call ( "addPermissionChangedHandler" , new IPermissionChangedHandler ( this ) ) ;
63
63
_notifications . Call ( "setNotificationWillShowInForegroundHandler" , new INotificationWillShowInForegroundHandler ( this ) ) ;
64
64
_notifications . Call ( "setNotificationClickHandler" , new INotificationClickHandler ( this ) ) ;
65
65
}
@@ -73,7 +73,7 @@ public IPermissionChangedHandler(AndroidNotificationsManager notificationsManage
73
73
74
74
/// <param name="permission">boolean</param>
75
75
public void onPermissionChanged ( bool permission ) {
76
- _parent . PermissionChanged ? . Invoke ( permission ) ;
76
+ UnityMainThreadDispatch . Post ( state => _parent . PermissionChanged ? . Invoke ( permission ) ) ;
77
77
}
78
78
}
79
79
@@ -94,9 +94,8 @@ public void notificationWillShowInForeground(AndroidJavaObject notificationRecei
94
94
}
95
95
96
96
var notification = _getNotification ( notifJO ) ;
97
- var resultNotif = _parent . WillShow ( notification ) ;
98
97
99
- notificationReceivedEvent . Call ( "complete" , resultNotif != null ? notifJO : null ) ;
98
+ UnityMainThreadDispatch . Post ( state => notificationReceivedEvent . Call ( "complete" , _parent . WillShow ( notification ) != null ? notifJO : null ) ) ;
100
99
}
101
100
}
102
101
@@ -120,7 +119,7 @@ public void notificationClicked(AndroidJavaObject result) {
120
119
action = action
121
120
} ;
122
121
123
- _parent . Clicked ? . Invoke ( notifClickResult ) ;
122
+ UnityMainThreadDispatch . Post ( state => _parent . Clicked ? . Invoke ( notifClickResult ) ) ;
124
123
}
125
124
}
126
125
@@ -144,7 +143,7 @@ private static Notification _getNotification(AndroidJavaObject notifJO) {
144
143
145
144
private static NotificationAction _getAction ( AndroidJavaObject actionJO ) {
146
145
var action = actionJO . ToSerializable < NotificationAction > ( ) ;
147
- action . actionID = actionJO . Call < string > ( "getActionId" ) ;
146
+ // action.actionID = actionJO.Call<string>("getActionId");
148
147
149
148
return action ;
150
149
}
0 commit comments