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

Commit fcc229d

Browse files
committed
Upgrade to 8.1.0.
Closes #2123
1 parent 9b5c7f7 commit fcc229d

File tree

6 files changed

+31
-11
lines changed

6 files changed

+31
-11
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html
1212

1313
### Fixed
1414

15+
## [8.1.0] 2021-09-03
16+
17+
### Features
18+
19+
- (iOS) Upgrade `@react-native-community/push-notification-ios` to version [1.10.0](https://github.com/react-native-push-notification/ios/releases/tag/v1.10.0)
20+
- (iOS) Allow `month`, `week`, `day`, `hour`, `minute` as `repeatType` for iOS.
21+
22+
### Fixed
23+
24+
- (Android): Fix Android 12 PendingIntent [#2130](https://github.com/zo0r/react-native-push-notification/pull/2130)
25+
1526
## [8.0.1] 2021-08-24
1627

1728
### Fixed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -643,13 +643,16 @@ https://developer.android.com/training/monitoring-device-state/doze-standby
643643
(optional) Specify `repeatType` and optionally `repeatTime` (Android-only) while scheduling the local notification. Check the local notification example above.
644644

645645
### iOS
646-
Property `repeatType` can only be `day`.
646+
Property `repeatType` can only be `month`, `week`, `day`, `hour`, `minute`.
647+
648+
NOTE: `repeatTime` do not work with iOS.
647649

648650
### Android
649651
Property `repeatType` could be one of `month`, `week`, `day`, `hour`, `minute`, `time`.
650652

651653
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.
652654
For example, to configure a notification every other day
655+
653656
```javascript
654657
PushNotification.localNotificationSchedule({
655658
...

example/NotifService.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ export default class NotifService {
118118
autoCancel: true, // (optional) default: true
119119
largeIcon: 'ic_launcher', // (optional) default: "ic_launcher"
120120
smallIcon: 'ic_notification', // (optional) default: "ic_notification" with fallback for "ic_launcher"
121-
bigText: 'My big text that will be shown when notification is expanded', // (optional) default: "message" prop
121+
bigText: 'My <strong>big text</strong> that will be shown when notification is expanded', // (optional) default: "message" prop
122122
subText: 'This is a subText', // (optional) default: none
123123
color: 'blue', // (optional) default: system default
124124
vibrate: true, // (optional) default: true

example/ios/Podfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ PODS:
245245
- React-Core (= 0.63.3)
246246
- React-cxxreact (= 0.63.3)
247247
- React-jsi (= 0.63.3)
248-
- RNCPushNotificationIOS (1.9.0):
248+
- RNCPushNotificationIOS (1.10.0):
249249
- React-Core
250250
- Yoga (1.14.0)
251251

@@ -367,7 +367,7 @@ SPEC CHECKSUMS:
367367
React-RCTText: 65a6de06a7389098ce24340d1d3556015c38f746
368368
React-RCTVibration: 8e9fb25724a0805107fc1acc9075e26f814df454
369369
ReactCommon: 4167844018c9ed375cc01a843e9ee564399e53c3
370-
RNCPushNotificationIOS: 5bffde624d1fd15bfc8b2fd202b012a517a6dc9b
370+
RNCPushNotificationIOS: 5ee247e594d0b5df3cd7be74b51035a0d91807eb
371371
Yoga: 7d13633d129fd179e01b8953d38d47be90db185a
372372

373373
PODFILE CHECKSUM: 9f7efe26f7ad5184f28ac62478069370942924e2

index.js

+11-5
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,14 @@ Notifications.localNotificationSchedule = function({...details}) {
250250
details.userInfo = details.userInfo || {};
251251
details.userInfo.image = details.picture;
252252
}
253+
254+
const repeatsComponent = {
255+
second: details.repeatType == "minute",
256+
minute: details.repeatType == "hour",
257+
hour: details.repeatType == "day",
258+
day: details.repeatType == "month",
259+
dayOfWeek: details.repeatType == "week",
260+
};
253261

254262
const iosDetails = {
255263
id: (!details.id ? Math.floor(Math.random() * Math.pow(2, 32)).toString() : details.id),
@@ -261,7 +269,8 @@ Notifications.localNotificationSchedule = function({...details}) {
261269
isSilent: details.playSound === false,
262270
category: details.category,
263271
userInfo: details.userInfo,
264-
repeats: (details.repeatType && details.repeatType == "day"),
272+
repeats: ['minute', 'hour', 'day', 'week', 'month'].includes(details.repeatType),
273+
repeatsComponent: repeatsComponent
265274
};
266275

267276
if (details.number) {
@@ -304,10 +313,7 @@ Notifications.localNotificationSchedule = function({...details}) {
304313

305314
details.fireDate = details.date.getTime();
306315
delete details.date;
307-
// ignore iOS only repeatType
308-
if (['year'].includes(details.repeatType)) {
309-
delete details.repeatType;
310-
}
316+
311317
this.handler.scheduleLocalNotification(details);
312318
}
313319
};

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-push-notification",
3-
"version": "8.0.1",
3+
"version": "8.1.0",
44
"description": "React Native Local and Remote Notifications",
55
"main": "index.js",
66
"scripts": {
@@ -24,7 +24,7 @@
2424
"url": "git+ssh://[email protected]:zo0r/react-native-push-notification.git"
2525
},
2626
"peerDependencies": {
27-
"@react-native-community/push-notification-ios": "^1.9.0",
27+
"@react-native-community/push-notification-ios": "^1.10.0",
2828
"react-native": ">=0.33"
2929
},
3030
"author": "zo0r <http://zo0r.me>",

0 commit comments

Comments
 (0)