From 67c55ca0bff3dda3513722723873e24b0dbc7d1b Mon Sep 17 00:00:00 2001 From: Vincent Pizzo Date: Mon, 5 Apr 2021 09:26:24 -0700 Subject: [PATCH 1/3] Add ability to request/check more iOS permissions such as critical alerts --- example/index.js | 13 +++-- lib/ios/RNBridgeModule.m | 2 +- lib/ios/RNCommandsHandler.h | 2 +- lib/ios/RNCommandsHandler.m | 2 +- lib/ios/RNNotificationCenter.h | 2 +- lib/ios/RNNotificationCenter.m | 47 ++++++++++++------- .../RNCommandsHandlerIntegrationTest.m | 31 ++++++------ lib/src/Notifications.ts | 5 +- lib/src/NotificationsIOS.ts | 5 +- lib/src/adapters/NativeCommandsSender.ts | 11 ++--- lib/src/commands/Commands.test.ts | 20 ++++++-- lib/src/commands/Commands.ts | 5 +- lib/src/interfaces/NotificationPermissions.ts | 8 +++- website/docs/api/general-api.md | 4 +- website/docs/api/ios-api.md | 21 +++++---- website/docs/docs/subscription.md | 3 ++ 16 files changed, 112 insertions(+), 69 deletions(-) diff --git a/example/index.js b/example/index.js index 819c02337..19ebe571a 100644 --- a/example/index.js +++ b/example/index.js @@ -127,6 +127,12 @@ class NotificationsExampleApp extends Component { ); } + checkPermissions() { + Notifications.ios.checkPermissions().then((currentPermissions) => { + console.warn(currentPermissions); + }); + } + render() { const notifications = this.state.notifications.map((notification, idx) => ( @@ -144,9 +150,10 @@ class NotificationsExampleApp extends Component {