My notification won’t repeat

I’m trying to create a notification that repeats every interval (eg 15 mins), I’m using an alarm manager and a notify service.

here’s the section where I start the alarm:

private void alarmMethod(){
        Intent myIntent = new Intent(this , NotifyService.class);
        AlarmManager alarmManager = (AlarmManager)getSystemService(ALARM_SERVICE);
        pendingIntent = PendingIntent.getService(this, 0, myIntent, 0);

        Calendar calendar = Calendar.getInstance();
        Calendar currentCal = Calendar.getInstance();


        calendar.set(Calendar.SECOND, currentCal.get(Calendar.SECOND));
        calendar.set(Calendar.MINUTE, currentCal.get(Calendar.MINUTE) + 1);
        calendar.set(Calendar.HOUR, currentCal.get(Calendar.HOUR));
        calendar.set(Calendar.AM_PM, currentCal.get(Calendar.AM_PM));

        long intendedTime = calendar.getTimeInMillis();
        long currentTime = currentCal.getTimeInMillis();

        if(intendedTime >= currentTime){
            // you can add buffer time too here to ignore some small differences in milliseconds
            // set from today
            alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, intendedTime,
                    AlarmManager.INTERVAL_FIFTEEN_MINUTES, pendingIntent);

        } else{
            // set from next day
            // you might consider using calendar.add() for adding one day to the current day
            //calendar.add(Calendar.DAY_OF_MONTH, 1);
            intendedTime = calendar.getTimeInMillis();
            alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, intendedTime,
                    AlarmManager.INTERVAL_FIFTEEN_MINUTES, pendingIntent);
        }
        Toast.makeText(LoginActivity.this, "Starting Alarm", Toast.LENGTH_LONG).show();

        /*
        if (alarmManager != null) {
            alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), 1000 * 60 * 60 * 24, pendingIntent);
        }*/

    }

Heres the notify service:

public class NotifyService extends Service {
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
    @Override
    public void onCreate(){
        Uri sound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);

        NotificationManager mNM = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
        Intent intent1 = new Intent(this.getApplicationContext(), LoginActivity.class);

        intent1.putExtra("receivedTokens", true);

        PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent1, 0);

        Notification.Builder mNotify = new Notification.Builder(this)
                .setContentTitle("Token bonus!")
                .setContentText("You can now receive your daily token bonus!")
                .setSmallIcon(R.drawable.event)
                .setContentIntent(pIntent)
                .setSound(sound)
                .setDefaults(Notification.DEFAULT_LIGHTS | Notification.FLAG_AUTO_CANCEL)
                //.addAction(0, "Login now", pIntent)
                .setAutoCancel(true);
        //int flags = Notification.FLAG_AUTO_CANCEL;
        //mNotify.build().flags = flags;
        if (mNM != null) {
            mNM.notify(1,mNotify.build());
        }

    }
}

And for when the device reboot here’s the device reboot receiver:

public class DeviceBootReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals("android.intent.action.BOOT_COMPLETED")) {
            /* Setting the alarm here */
            Intent alarmIntent = new Intent(context, NotifyService.class);
            PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, alarmIntent, 0);

            AlarmManager manager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
            int interval = (int) AlarmManager.INTERVAL_FIFTEEN_MINUTES;
            manager.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), interval, pendingIntent);

            Toast.makeText(context, "Starting Alarm...", Toast.LENGTH_SHORT).show();
        }
    }
}

and here a section of the android manifest file:

<uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>



        <!-- Will not be called unless the application explicitly enables it -->
        <receiver android:name=".DeviceBootReceiver"
            android:enabled="true">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
            </intent-filter>
        </receiver>