I am a new React Native developer and just started working with native modules so this is all new. I want to be able to set a reminder in x minutes prior to my calendar event on Android. i.e. reminder at start time or 5 minutes before. How do I do this?
The code:
private void presentEventAddingActivity(ReadableMap config) {
try {
setPriorEventId(getCurrentActivity());
final Intent calendarIntent = new Intent(Intent.ACTION_INSERT);
calendarIntent
.setType("vnd.android.cursor.item/event")
.putExtra("title", config.getString("title"));
if (config.hasKey("startDate")) {
calendarIntent.putExtra("beginTime", getTimestamp(config.getString("startDate")));
}
if (config.hasKey("endDate")) {
calendarIntent.putExtra("endTime", getTimestamp(config.getString("endDate")));
}
if (config.hasKey("alarm")) {
calenderIntent.putExtra("hasAlarm", 1),
}
getReactApplicationContext().startActivityForResult(calendarIntent, ADD_EVENT_REQUEST_CODE, Bundle.EMPTY);
} catch (Exception e) {
rejectPromise(e);
}
}