From a2c1c813430b9280799ba339e4bd893aa32a9438 Mon Sep 17 00:00:00 2001 From: James Holcomb Date: Wed, 8 Sep 2021 07:04:40 -0500 Subject: [PATCH] feat: ios add permissions to check permissions (#762) (#1) * FEAT: ios add permissions to check permissions (#762) * Update package.json version to 4.1.2 and generate CHANGELOG.gren.md [ci skip] Co-authored-by: DanielEliraz Co-authored-by: wixmobile --- CHANGELOG.gren.md | 69 ++++++++++++++----- example/index.js | 7 ++ lib/ios/RNNotificationCenter.m | 2 + lib/src/commands/Commands.test.ts | 2 + lib/src/interfaces/NotificationPermissions.ts | 2 + package.json | 2 +- 6 files changed, 66 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.gren.md b/CHANGELOG.gren.md index fe324aa75..b686546f7 100644 --- a/CHANGELOG.gren.md +++ b/CHANGELOG.gren.md @@ -1,5 +1,13 @@ # Changelog +## 4.1.1 (21/07/2021) + +#### Enhancements: + +- resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) + +--- + ## 4.1.0 (14/07/2021) #### Enhancements: @@ -123,6 +131,7 @@ #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -159,10 +168,11 @@ --- -## 2.1.0 (31/12/1969) +## v1.4.0 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -199,10 +209,11 @@ --- -## v1.4.0 (31/12/1969) +## v1.1.17 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -239,10 +250,11 @@ --- -## v1.1.17 (31/12/1969) +## v1.1.12 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -279,10 +291,11 @@ --- -## v1.1.12 (31/12/1969) +## 4.1.2 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -319,10 +332,11 @@ --- -## 4.1.1 (31/12/1969) +## 3.0.0-beta.4 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -359,10 +373,11 @@ --- -## 3.0.0-beta.4 (31/12/1969) +## 3.0.0-beta.2 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -399,10 +414,11 @@ --- -## 3.0.0-beta.2 (31/12/1969) +## 3.0.0 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -439,10 +455,11 @@ --- -## 3.0.0 (31/12/1969) +## 3.0.0-beta.1 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -483,6 +500,7 @@ #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -519,10 +537,11 @@ --- -## 3.0.0-beta.1 (31/12/1969) +## 3.0.0-beta.0 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -559,10 +578,11 @@ --- -## 3.0.0-beta.0 (31/12/1969) +## 3.0.0-alpha.0 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -599,10 +619,11 @@ --- -## 3.0.0-alpha.0 (31/12/1969) +## 2.1.7 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -639,10 +660,11 @@ --- -## 2.1.7 (31/12/1969) +## 2.1.6 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -683,6 +705,7 @@ #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -719,10 +742,11 @@ --- -## 2.1.6 (31/12/1969) +## 2.1.5 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -759,10 +783,11 @@ --- -## 2.1.5 (31/12/1969) +## 2.1.4 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -799,10 +824,11 @@ --- -## 2.1.4 (31/12/1969) +## 2.1.4-beta.0 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -839,10 +865,11 @@ --- -## 2.1.4-beta.0 (31/12/1969) +## 2.1.3 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -879,10 +906,11 @@ --- -## 2.1.3 (31/12/1969) +## 2.1.0 (31/12/1969) #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -923,6 +951,7 @@ #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -963,6 +992,7 @@ #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -1003,6 +1033,7 @@ #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -1043,6 +1074,7 @@ #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -1083,6 +1115,7 @@ #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -1123,6 +1156,7 @@ #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) @@ -1163,6 +1197,7 @@ #### Enhancements: +- FEAT: ios add permissions to check permissions [#762](https://github.com/wix/react-native-notifications/pull/762) by [DanielEliraz](https://github.com/DanielEliraz) - resiter remote on provisional approve [#759](https://github.com/wix/react-native-notifications/pull/759) by [DanielEliraz](https://github.com/DanielEliraz) - expose provisional state [#756](https://github.com/wix/react-native-notifications/pull/756) by [DanielEliraz](https://github.com/DanielEliraz) - Add ability to request/check more iOS permissions [#752](https://github.com/wix/react-native-notifications/pull/752) by [DanielEliraz](https://github.com/DanielEliraz) diff --git a/example/index.js b/example/index.js index 3d097fbbf..94bd0e261 100644 --- a/example/index.js +++ b/example/index.js @@ -154,6 +154,12 @@ class NotificationsExampleApp extends Component { }); } + isRegistered() { + Notifications.isRegisteredForRemoteNotifications().then((registered) => { + console.warn(registered); + }); + } + render() { const notifications = this.state.notifications.map((notification, idx) => ( @@ -181,6 +187,7 @@ class NotificationsExampleApp extends Component { }