@@ -39,7 +39,7 @@ class CustomTimerNotificationModule: ReactContextBaseJavaModule {
39
39
lateinit var builder: Notification .Builder
40
40
val channelId: String = " 255"
41
41
var packageName: String = " "
42
-
42
+ var removedNotification = false ;
43
43
lateinit var myContext: ReactApplicationContext ;
44
44
45
45
constructor (context: ReactApplicationContext ): super (context){
@@ -56,7 +56,7 @@ class CustomTimerNotificationModule: ReactContextBaseJavaModule {
56
56
params.putString(" action" , extras!! .getString(" action" ))
57
57
params.putString(" payload" , extras!! .getString(" payload" ))
58
58
removeNotification(extras!! .getInt(" id" ),foregound)
59
-
59
+ removedNotification = true
60
60
sendEvent(" notificationClick" , params)
61
61
} catch (e: Exception ) {
62
62
println (e)
@@ -90,7 +90,7 @@ class CustomTimerNotificationModule: ReactContextBaseJavaModule {
90
90
val payload = objectData.getString(" payload" );
91
91
val id = objectData.getInt(" id" );
92
92
val isCountDown = objectData.getBoolean(" isCountDown" )
93
-
93
+
94
94
val datetime = objectData.getString(" date" )
95
95
val sdf = SimpleDateFormat (" dd-MM-yyyy HH:mm:ss" , Locale .ENGLISH )
96
96
@@ -170,6 +170,7 @@ class CustomTimerNotificationModule: ReactContextBaseJavaModule {
170
170
}
171
171
172
172
notificationBuilder.setCustomContentView(notificationLayout)
173
+ if (! removedNotification)
173
174
notificationManager.notify(id,notificationBuilder.build())
174
175
}, Math .abs(elapsed))
175
176
return notificationBuilder
0 commit comments