From 0634e2cf680f8192d145476c55812bfef5827eaa Mon Sep 17 00:00:00 2001 From: Jesse Katsumata Date: Sat, 24 Oct 2020 19:20:13 +0900 Subject: [PATCH 1/9] feat: addNotificationRequestMethod --- example/App.js | 18 ++++++++-- ios/RNCPushNotificationIOS.m | 45 +++++++++++++++++++++++ js/index.js | 70 +++++++++++++++++++++++++++++++++--- 3 files changed, 127 insertions(+), 6 deletions(-) diff --git a/example/App.js b/example/App.js index 28196f922..1c6672eff 100644 --- a/example/App.js +++ b/example/App.js @@ -101,6 +101,15 @@ export const App = () => { }); }; + const addNotificationRequest = () => { + PushNotificationIOS.addNotificationRequest({ + id: 'test', + title: 'title', + subtitle: 'subtitle', + body: 'body', + }); + }; + const removeAllPendingNotificationRequests = () => { PushNotificationIOS.removeAllPendingNotificationRequests(); }; @@ -132,6 +141,7 @@ export const App = () => { const result = ` Title: ${notification.getTitle()};\n + Subtitle: ${notification.getSubtitle()};\n Message: ${notification.getMessage()};\n badge: ${notification.getBadgeCount()};\n sound: ${notification.getSound()};\n @@ -162,7 +172,8 @@ export const App = () => { Alert.alert( 'Local Notification Received', `Alert title: ${notification.getTitle()}, - 'Alert message: ${notification.getMessage()}, + Alert subtitle: ${notification.getSubtitle()}, + Alert message: ${notification.getMessage()}, Notification is clicked: ${String(isClicked)}.`, [ { @@ -191,6 +202,10 @@ export const App = () => { onPress={scheduleLocalNotification} label="Schedule fake local notification" /> +