@@ -21,6 +21,7 @@ public class AndroidTest : MonoBehaviour
21
21
private Logger m_LOGGER ;
22
22
private int _notificationExplicitID ;
23
23
private Button ButtonModifyExplicitID ;
24
+ private Button ButtonCancelExplicitID ;
24
25
25
26
public int notificationExplicitID
26
27
{
@@ -30,6 +31,7 @@ public int notificationExplicitID
30
31
_notificationExplicitID = value ;
31
32
bool buttonsEnabled = _notificationExplicitID != 0 ;
32
33
ButtonModifyExplicitID . interactable = buttonsEnabled ;
34
+ ButtonCancelExplicitID . interactable = buttonsEnabled ;
33
35
}
34
36
}
35
37
@@ -116,6 +118,7 @@ private void InstantiateAllTestButtons()
116
118
m_groups [ "Modify" ] = new OrderedDictionary ( ) ;
117
119
//m_groups["Modify"]["Create notification preset"] = new Action(() => { });
118
120
m_groups [ "Modify" ] [ "Modify pending Explicit notification" ] = new Action ( ( ) => { ModifyExplicitNotification ( ) ; } ) ;
121
+ m_groups [ "Modify" ] [ "Cancel pending Explicit notification" ] = new Action ( ( ) => { CancelExplicitNotification ( ) ; } ) ;
119
122
120
123
m_groups [ "Send" ] = new OrderedDictionary ( ) ;
121
124
foreach ( AndroidNotificationTemplate template in Resources . LoadAll ( "AndroidNotifications" , typeof ( AndroidNotificationTemplate ) ) )
@@ -231,6 +234,8 @@ private void InstantiateAllTestButtons()
231
234
}
232
235
ButtonModifyExplicitID = GameObject . Find ( "Modify/Modify pending Explicit notification" ) . GetComponent < Button > ( ) ;
233
236
ButtonModifyExplicitID . interactable = false ;
237
+ ButtonCancelExplicitID = GameObject . Find ( "Modify/Cancel pending Explicit notification" ) . GetComponent < Button > ( ) ;
238
+ ButtonCancelExplicitID . interactable = false ;
234
239
m_gameObjectReferences . ButtonGroupTemplate . gameObject . SetActive ( false ) ;
235
240
}
236
241
@@ -248,6 +253,14 @@ public void ModifyExplicitNotification()
248
253
. Properties ( template , 1 ) ;
249
254
}
250
255
256
+ public void CancelExplicitNotification ( )
257
+ {
258
+ AndroidNotificationCenter . CancelScheduledNotification ( notificationExplicitID ) ;
259
+ notificationExplicitID = 0 ;
260
+ m_LOGGER
261
+ . Blue ( $ "[{ DateTime . Now . ToString ( "HH:mm:ss.ffffff" ) } ] Call { MethodBase . GetCurrentMethod ( ) . Name } ") ;
262
+ }
263
+
251
264
public void SendNotification ( AndroidNotification notification , string channel = "default_channel" , int notificationID = 0 , bool log = true )
252
265
{
253
266
if ( log )
0 commit comments