package com.emekalites.react.alarm.notification;

import android.app.Application;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.facebook.react.modules.core.DeviceEventManagerModule;

public class AlarmDismissReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        try {
            AlarmUtil alarmUtil = new AlarmUtil((Application) context.getApplicationContext());

            if (ANModule.getReactAppContext() != null) {
                int notificationId = intent.getExtras().getInt(Constants.DISMISSED_NOTIFICATION_ID);
                ANModule.getReactAppContext().getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class).emit("OnNotificationDismissed", "{\"id\": \"" + notificationId + "\"}");

                alarmUtil.removeFiredNotification(notificationId);

                alarmUtil.doCancelAlarm(notificationId);
            }
        } catch (Exception e) {
            alarmUtil.stopAlarmSound();
            System.err.println("Exception when handling notification dismiss. " + e);
        }
    }
}

@@ -387,26 +387,8 @@
 ) %7B%0A
-        try %7B%0A    
     
@@ -475,16 +475,29 @@
 ext());%0A
+        try %7B
 %0A       

Update AlarmDismissReceiver.java