You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-1Lines changed: 34 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -324,14 +324,47 @@ request is an object containing:
324
324
-`body` : The message displayed in the notification alert.
325
325
-`badge` The number to display as the app's icon badge. Setting the number to 0 removes the icon badge.
326
326
-`fireDate` : The date and time when the system should deliver the notification.
327
-
-`repeats` : Sets notification to repeat daily. Must be used with fireDate.
327
+
-`repeats` : Sets notification to repeat. Must be used with fireDate and repeatsComponent.
328
+
-`repeatsComponent`: An object indicating which parts of fireDate should be repeated.
328
329
-`sound` : The sound played when the notification is fired.
329
330
-`category` : The category of this notification, required for actionable notifications.
330
331
-`isSilent` : If true, the notification will appear without sound.
331
332
-`isCritical` : If true, the notification sound be played even when the device is locked, muted, or has Do Not Disturb enabled.
332
333
-`criticalSoundVolume` : A number between 0 and 1 for volume of critical notification. Default volume will be used if not specified.
333
334
-`userInfo` : An object containing additional notification data.
334
335
336
+
request.repeatsComponent is an object containing (each field is optionnal):
337
+
338
+
-`month`: Will repeat every selected month in your fireDate.
339
+
-`day`: Will repeat every selected day in your fireDate.
340
+
-`hour`: Will repeat every selected hour in your fireDate.
341
+
-`minute`: Will repeat every selected minute in your fireDate.
342
+
-`second`: Will repeat every selected second in your fireDate.
343
+
-`nanosecond`: Will repeat every selected nanosecond in your fireDate.
344
+
345
+
For example, let’s say you want to have a notification repeating every day at 23:54, starting tomorrow, you will use something like this:
346
+
347
+
```javascript
348
+
constgetCorrectDate= () => {
349
+
constdate=newDate();
350
+
date.setDate(date.getDate() +1);
351
+
date.setHours(23);
352
+
date.setMinutes(54);
353
+
return date;
354
+
};
355
+
356
+
PushNotificationIOS.addNotificationRequest({
357
+
fireDate:getCorrectDate(),
358
+
repeats:true,
359
+
repeatsComponent: {
360
+
hour:true,
361
+
minute:true,
362
+
},
363
+
});
364
+
```
365
+
366
+
If you want to repeat every time the clock reach 54 minutes (like 00:54, 01:54, and so on), just switch hour to false. Every field is used to indicate at what time the notification should be repeated, exactly like you could do on iOS.
0 commit comments