public boolean schedule() {
        Date triggerDate = triggerhandler.getTriggerDate();

        if (triggerDate == null) {
            Log.e(TAG, "schedule was wrongly called with triggerDate = null, options=" + options);
            return false;
        }

        // Create channel if not exists
        Manager.createChannel(context, options);

        // Store notification data for restoration
        // Needed for NotificationClickActivity and ClearReceiver
        storeInSharedPreferences();

        // Date is in the past, show directly
        if (!triggerDate.after(new Date())) {
            show(false);
            scheduleNext();
            return false;
        }

        boolean canScheduleExactAlarms = Manager.canScheduleExactAlarms(context);

        // Intent when the alarm goes off
        Intent alarmFiresIntent = new Intent(context, TriggerReceiver.class)
            // action identifier for the intent like "NOTIFICATION_ID1173"
            .setAction(getIntentActionIdentifier())
            // Notification-ID
            .putExtra(EXTRA_ID, options.getId());
        
        Log.d(TAG, "Schedule notification" +
            ", notificationId: " + options.getId() +
            ", canScheduleExactAlarms: " + canScheduleExactAlarms +
            ", intentAction=" + alarmFiresIntent.getAction() +
            ", occurrence: " + triggerhandler.getOccurrence() +
            ", triggerDate: " + triggerDate +
            ", options=" + options);
        
        // AlarmManager.set: If there is already an alarm scheduled for the same IntentSender,
        // that previous alarm will first be canceled.
        PendingIntent alarmFiresPendingIntent = PendingIntent.getBroadcast(context, 0, alarmFiresIntent, PendingIntent.FLAG_IMMUTABLE);

        // A maximum of 500 alarms can be scheduled, catch exception
        try {
            // Execute alarm even when the system is in low-power idle (a.k.a. doze) modes.
            if (options.isAndroidAllowWhileIdle()) {
                if (canScheduleExactAlarms) {
                    getAlarmManager().setExactAndAllowWhileIdle(
                        options.getAndroidAlarmType(), triggerDate.getTime(), alarmFiresPendingIntent);
                } else {
                    getAlarmManager().setAndAllowWhileIdle(
                        options.getAndroidAlarmType(), triggerDate.getTime(), alarmFiresPendingIntent);
                }

                // Execute alarm by RTC or RTC_WAKEUP
            } else {
                if (canScheduleExactAlarms) {
                    getAlarmManager().setExact(
                        options.getAndroidAlarmType(), triggerDate.getTime(), alarmFiresPendingIntent);
                } else {
                    getAlarmManager().set(
                        options.getAndroidAlarmType(), triggerDate.getTime(), alarmFiresPendingIntent);
                }
            }

            return true;

            // Maximum 500 alarms can be scheduled.
            // If more are scheduled, an exception will be thrown.
        } catch (Exception exception) {
            Log.d(TAG, "Exception occurred during scheduling notification", exception);
            return false;
        }
    }
Schedules the notification with the current state of the dateTrigger.
If the triggerDate is in the past, the notification will be triggered directly.
@return true if the notification was scheduled, false otherwise, which can happen,
if the notification was triggered directly or an error occured.
src/android/Notification.java