Closed ayubmm closed 4 years ago
I tried to add AlarmUtil alarmUtil = new AlarmUtil((Application) context.getApplicationContext()); and change the code from :
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);
}
to :
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 alarmUtil = new AlarmUtil((Application) context.getApplicationContext());
alarmUtil.stopAlarmSound();
System.err.println("Exception when handling notification dismiss. " + e);
}
I was just messing around because I haven't learned java. but now the appdebug is installed. Is this a solution? is there anyone facing the same problem ?
I have the same problem.
I think this pr is related.
https://github.com/emekalites/react-native-alarm-notification/pull/85
I have the same problem. anyone can help us?
I have the same problem. anyone can help us?
Try to change it like I did in this comment :
I tried to add AlarmUtil alarmUtil = new AlarmUtil((Application) context.getApplicationContext()); and change the code from :
`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); }`
to :
`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 alarmUtil = new AlarmUtil((Application) context.getApplicationContext()); alarmUtil.stopAlarmSound(); System.err.println("Exception when handling notification dismiss. " + e); }`
I was just messing around because I haven't learned java. but now the appdebug is installed. Is this a solution? is there anyone facing the same problem ?
Feel free to make the changes made in this commit and open a pull request:
Upon accidant i made more commits to my personal project, however, the above fixes the issue.
I submitted a PR to fix the compilation problem https://github.com/emekalites/react-native-alarm-notification/pull/90
v1.7.1 takes care of this, thanks guys.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings 21 actionable tasks: 21 executed /home/ayub/Documents/Project React Native/todoList/node_modules/react-native-alarm-notification/android/src/main/java/com/emekalites/react/alarm/notification/AlarmDismissReceiver.java:25: error: cannot find symbol alarmUtil.stopAlarmSound(); ^ symbol: variable alarmUtil location: class AlarmDismissReceiver 1 error