Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit d19a187

Browse files
committed
Update Readme on how to use repeatTime
1 parent ecdaf62 commit d19a187

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ PushNotification.localNotification({
324324
ignoreInForeground: false, // (optional) if true, the notification will not be visible when the app is in the foreground (useful for parity with how iOS notifications appear). should be used in combine with `com.dieam.reactnativepushnotification.notification_foreground` setting
325325
shortcutId: "shortcut-id", // (optional) If this notification is duplicative of a Launcher shortcut, sets the id of the shortcut, in case the Launcher wants to hide the shortcut, default undefined
326326
onlyAlertOnce: false, // (optional) alert will open only once with sound and notify, default: false
327+
repeatTime: 1, // (optional) Increment of configured repeateType. Check 'Repeating Notifications' section for more info.
327328

328329
when: null, // (optional) Add a timestamp (Unix timestamp value in milliseconds) pertaining to the notification (usually the time the event occurred). For apps targeting Build.VERSION_CODES.N and above, this time is not shown anymore by default and must be opted into by using `showWhen`, default: null.
329330
usesChronometer: false, // (optional) Show the `when` field as a stopwatch. Instead of presenting `when` as a timestamp, the notification will show an automatically updating display of the minutes and seconds since when. Useful when showing an elapsed time (like an ongoing phone call), default: false.
@@ -641,7 +642,18 @@ https://developer.android.com/training/monitoring-device-state/doze-standby
641642
Property `repeatType` can only be `day`.
642643

643644
### Android
644-
Property `repeatType` could be one of `month`, `week`, `day`, `hour`, `minute`, `time`. If specified as time, it should be accompanied by one more parameter `repeatTime` which should the number of milliseconds between each interval.
645+
Property `repeatType` could be one of `month`, `week`, `day`, `hour`, `minute`, `time`.
646+
647+
The interval used can be configured to a different interval using `repeatTime`. If `repeatType` is `time`, `repeatTime` must be specified as the number of milliseconds between each interval.
648+
For example, to configure a notification every other day
649+
```javascript
650+
PushNotification.localNotificationSchedule({
651+
...
652+
repeatType: 'day',
653+
repeatTime: 2,
654+
...
655+
});
656+
```
645657

646658
## Notification Actions
647659

0 commit comments

Comments
 (0)