From 3612529e5211fd9844a2c9997fb17384404c155f Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 24 Nov 2017 18:06:45 +0000 Subject: [PATCH] iOS: Testing notification --- ReactNativeClient/root.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/ReactNativeClient/root.js b/ReactNativeClient/root.js index 8ec358e6f..72a153ade 100644 --- a/ReactNativeClient/root.js +++ b/ReactNativeClient/root.js @@ -1,5 +1,5 @@ const React = require('react'); const Component = React.Component; -const { Keyboard, NativeModules } = require('react-native'); +const { Keyboard, NativeModules, PushNotificationIOS } = require('react-native'); const { connect, Provider } = require('react-redux'); const { BackButtonService } = require('lib/services/back-button.js'); const { createStore, applyMiddleware } = require('redux'); @@ -366,14 +366,25 @@ async function initialize(dispatch, backButtonHandler) { } + reg.logger().info('Scheduling iOS notification'); - - PushNotification.localNotificationSchedule({ - message: "My Notification Message", // (required) - date: new Date(Date.now() + (10 * 1000)) // in 60 secs + PushNotificationIOS.scheduleLocalNotification({ + alertTitle: "From Joplin", + alertBody : "Testing notification on iOS", + fireDate: new Date(Date.now() + (10 * 1000)), }); + + // const r = PushNotification.localNotificationSchedule({ + // id: '222456', + // message: "My Notification Message", // (required) + // date: new Date(Date.now() + (10 * 1000)) // in 60 secs + // }); + + //PushNotification.cancelLocalNotifications({ id: '222456' }); + + reg.logger().info('Application initialized'); }