From 8ae0eacf17ce6ea5e35af1e18c95101877c1799e Mon Sep 17 00:00:00 2001 From: Tadeu Zagallo Date: Tue, 24 Mar 2015 05:31:11 -0700 Subject: [PATCH] [ReactNative] Open Source PushNotifications and move Badge Number methods and permission into it --- Examples/UIExplorer/AppStateExample.js | 67 ----- .../UIExplorer/PushNotificationIOSExample.js | 152 +++++++++++ .../UIExplorer.xcodeproj/project.pbxproj | 30 ++ Examples/UIExplorer/UIExplorerList.js | 2 +- Libraries/AppState/AppState.js | 28 -- .../PushNotificationIOS.js | 29 +- .../project.pbxproj | 256 ++++++++++++++++++ .../RCTPushNotificationManager.h | 9 +- .../RCTPushNotificationManager.m | 156 +++++++++++ Libraries/react-native/react-native.js | 2 +- ReactKit/Modules/RCTAppState.m | 22 -- ReactKit/Modules/RCTPushNotificationManager.m | 71 ----- 12 files changed, 626 insertions(+), 198 deletions(-) delete mode 100644 Examples/UIExplorer/AppStateExample.js create mode 100644 Examples/UIExplorer/PushNotificationIOSExample.js delete mode 100644 Libraries/AppState/AppState.js rename Libraries/{Utilities => PushNotificationIOS}/PushNotificationIOS.js (74%) create mode 100644 Libraries/PushNotificationIOS/RCTPushNotification.xcodeproj/project.pbxproj rename {ReactKit/Modules => Libraries/PushNotificationIOS}/RCTPushNotificationManager.h (51%) create mode 100644 Libraries/PushNotificationIOS/RCTPushNotificationManager.m delete mode 100644 ReactKit/Modules/RCTPushNotificationManager.m diff --git a/Examples/UIExplorer/AppStateExample.js b/Examples/UIExplorer/AppStateExample.js deleted file mode 100644 index 04a58c5e8..000000000 --- a/Examples/UIExplorer/AppStateExample.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - * - * @flow - */ -'use strict'; - -var React = require('react-native'); -var { - AppState, - StyleSheet, - Text, - TouchableHighlight, - View, -} = React; - -var Button = React.createClass({ - render: function() { - return ( - - - {this.props.label} - - - ); - } -}); - -var styles = StyleSheet.create({ - button: { - padding: 10, - alignItems: 'center', - justifyContent: 'center', - }, - buttonLabel: { - color: 'blue', - }, -}); - -exports.title = 'AppState'; -exports.description = 'App background status and badge value'; -exports.examples = [ -{ - title: 'Set Badge Number', - render: function() { - return ( - -