Honor repeatInterval when rescheduling outdated notiication
This commit is contained in:
parent
01c274a2f1
commit
11ccbb42f6
|
@ -365,11 +365,26 @@ public class RNFirebaseNotificationManager {
|
|||
Calendar currentFireDate = Calendar.getInstance();
|
||||
currentFireDate.setTimeInMillis(fireDate);
|
||||
|
||||
newFireDate.add(Calendar.DATE, 1);
|
||||
newFireDate.set(Calendar.DATE, currentFireDate.get(Calendar.DATE));
|
||||
newFireDate.set(Calendar.HOUR_OF_DAY, currentFireDate.get(Calendar.HOUR_OF_DAY));
|
||||
newFireDate.set(Calendar.MINUTE, currentFireDate.get(Calendar.MINUTE));
|
||||
newFireDate.set(Calendar.SECOND, currentFireDate.get(Calendar.SECOND));
|
||||
|
||||
switch (schedule.getString("repeatInterval")) {
|
||||
case "minute":
|
||||
newFireDate.add(Calendar.MINUTE, 1);
|
||||
break;
|
||||
case "hour":
|
||||
newFireDate.add(Calendar.HOUR, 1);
|
||||
break;
|
||||
case "day":
|
||||
newFireDate.add(Calendar.DATE, 1);
|
||||
break;
|
||||
case "week":
|
||||
newFireDate.add(Calendar.DATE, 7);
|
||||
break;
|
||||
}
|
||||
|
||||
fireDate = newFireDate.getTimeInMillis();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue