Skip to content

Commit

Permalink
Upgrade to 8.1.0.
Browse files Browse the repository at this point in the history
Closes #2123
  • Loading branch information
Dallas62 committed Sep 3, 2021
1 parent 9b5c7f7 commit fcc229d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html

### Fixed

## [8.1.0] 2021-09-03

### Features

- (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)
- (iOS) Allow `month`, `week`, `day`, `hour`, `minute` as `repeatType` for iOS.

### Fixed

- (Android): Fix Android 12 PendingIntent [#2130](https://github.com/zo0r/react-native-push-notification/pull/2130)

## [8.0.1] 2021-08-24

### Fixed
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -643,13 +643,16 @@ https://developer.android.com/training/monitoring-device-state/doze-standby
(optional) Specify `repeatType` and optionally `repeatTime` (Android-only) while scheduling the local notification. Check the local notification example above.

### iOS
Property `repeatType` can only be `day`.
Property `repeatType` can only be `month`, `week`, `day`, `hour`, `minute`.

NOTE: `repeatTime` do not work with iOS.

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

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.
For example, to configure a notification every other day

```javascript
PushNotification.localNotificationSchedule({
...
Expand Down
2 changes: 1 addition & 1 deletion example/NotifService.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export default class NotifService {
autoCancel: true, // (optional) default: true
largeIcon: 'ic_launcher', // (optional) default: "ic_launcher"
smallIcon: 'ic_notification', // (optional) default: "ic_notification" with fallback for "ic_launcher"
bigText: 'My big text that will be shown when notification is expanded', // (optional) default: "message" prop
bigText: 'My <strong>big text</strong> that will be shown when notification is expanded', // (optional) default: "message" prop
subText: 'This is a subText', // (optional) default: none
color: 'blue', // (optional) default: system default
vibrate: true, // (optional) default: true
Expand Down
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ PODS:
- React-Core (= 0.63.3)
- React-cxxreact (= 0.63.3)
- React-jsi (= 0.63.3)
- RNCPushNotificationIOS (1.9.0):
- RNCPushNotificationIOS (1.10.0):
- React-Core
- Yoga (1.14.0)

Expand Down Expand Up @@ -367,7 +367,7 @@ SPEC CHECKSUMS:
React-RCTText: 65a6de06a7389098ce24340d1d3556015c38f746
React-RCTVibration: 8e9fb25724a0805107fc1acc9075e26f814df454
ReactCommon: 4167844018c9ed375cc01a843e9ee564399e53c3
RNCPushNotificationIOS: 5bffde624d1fd15bfc8b2fd202b012a517a6dc9b
RNCPushNotificationIOS: 5ee247e594d0b5df3cd7be74b51035a0d91807eb
Yoga: 7d13633d129fd179e01b8953d38d47be90db185a

PODFILE CHECKSUM: 9f7efe26f7ad5184f28ac62478069370942924e2
Expand Down
16 changes: 11 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,14 @@ Notifications.localNotificationSchedule = function({...details}) {
details.userInfo = details.userInfo || {};
details.userInfo.image = details.picture;
}

const repeatsComponent = {
second: details.repeatType == "minute",
minute: details.repeatType == "hour",
hour: details.repeatType == "day",
day: details.repeatType == "month",
dayOfWeek: details.repeatType == "week",
};

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

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

details.fireDate = details.date.getTime();
delete details.date;
// ignore iOS only repeatType
if (['year'].includes(details.repeatType)) {
delete details.repeatType;
}

this.handler.scheduleLocalNotification(details);
}
};
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-push-notification",
"version": "8.0.1",
"version": "8.1.0",
"description": "React Native Local and Remote Notifications",
"main": "index.js",
"scripts": {
Expand All @@ -24,7 +24,7 @@
"url": "git+ssh://git@github.com:zo0r/react-native-push-notification.git"
},
"peerDependencies": {
"@react-native-community/push-notification-ios": "^1.9.0",
"@react-native-community/push-notification-ios": "^1.10.0",
"react-native": ">=0.33"
},
"author": "zo0r <http://zo0r.me>",
Expand Down

0 comments on commit fcc229d

Please sign in to comment.