package com.app.simplitend.patient_dashboard.foodreminders;

import static com.app.simplitend.patient_dashboard.foodreminders.FoodScheduler.FOOD_REMINDER_NOTIFICATION_ID;

import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

public class FoodReminderYesReceiver extends BroadcastReceiver {

    private static final String TAG = "FoodScheduler";
    public static final String WHICH_FOOD_REMINDER = "which_food_reminder";

    @Override
    public void onReceive(Context context, Intent intent) {
        int which = intent.getIntExtra(WHICH_FOOD_REMINDER, -1);
        if (which != -1){
            Log.d(TAG, "YES clicked for : " + which);
            NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
            notificationManager.cancel(FOOD_REMINDER_NOTIFICATION_ID + which);
        }
    }
}
