├── .DS_Store ├── .gitignore ├── .npmignore ├── LICENSE ├── README.md ├── RNNotificationActions.podspec ├── RNNotificationActions ├── .DS_Store ├── RNNotificationActions.h ├── RNNotificationActions.m ├── RNNotificationActions.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── alonso.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── alonso.xcuserdatad │ │ └── xcschemes │ │ ├── RNNotificationActions.xcscheme │ │ └── xcschememanagement.plist ├── RNNotificationActionsManager.h └── RNNotificationActionsManager.m ├── example ├── .gitignore ├── android │ ├── app │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ ├── react.gradle │ │ └── src │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── actionexamples │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── index.android.js ├── index.ios.js ├── ios │ ├── ActionExamples.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── ActionExamples.xcscheme │ ├── ActionExamples │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ └── ActionExamplesTests │ │ ├── ActionExamplesTests.m │ │ └── Info.plist └── package.json ├── index.ios.js └── package.json /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/holmesal/react-native-ios-notification-actions/213a29f1691ff718af7bb623f7bc1ddd2da4b647/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | 29 | .idea/ -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Compiled binary addons (http://nodejs.org/api/addons.html) 23 | build/Release 24 | 25 | # Dependency directory 26 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 27 | node_modules 28 | 29 | .idea/ 30 | 31 | # npmignore - content above this line is automatically generated and modifications may be omitted 32 | # see npmjs.com/npmignore for more details. 33 | example -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Alonso Holmes 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # looking for a maintainer 2 | 3 | I'm not actively maintaining this, so use it at your own risk and make sure to check the open issues. 4 | 5 | If you're interested in maintaining this repo, drop me a line at: hello(at)alonso.io 6 | 7 | # react-native-ios-notification-actions 8 | 9 | ![locked](https://zippy.gfycat.com/VibrantKaleidoscopicCrownofthornsstarfish.gif) 10 | ![unlocked](https://fat.gfycat.com/GrandTightEquestrian.gif) 11 | 12 | # tl;dr 13 | 14 | Notification **Actions** allow the user to interact with the push notification. Those shiny buttons that show up when you swipe a notification to the left on your lock screen, or pull down a notification that appears on the top of the screen? Each one of those buttons is an action. 15 | 16 | Notification **Categories** allow you to group multiple actions together. This Category is what you'll ultimately associate with a push notification. 17 | 18 | The basic workflow is: 19 | 20 | 1. Create and configure some actions. 21 | 2. Group them together into a category. 22 | 3. (optional) Implement some appdelegate methods to respond to actions. 23 | 4. Show a local (or remote) notification, and associate it with the category from (2) to show your actions. 24 | 25 | # Install 26 | 27 | ### rnpm (preferred) 28 | `rnpm install react-native-ios-notification-actions 29 | 30 | ### Manual 31 | 1. `npm install react-native-ios-notification-actions 32 | 2. Drag `./RNNotificationActions/RNNotificationActions.xcodeproj` into your project. 33 | 3. Add `libRNNotificationActions.a` to your `Link Binary With Libraries` build phase 34 | 35 | # Getting Started 36 | 1. Follow the instructions [here](https://facebook.github.io/react-native/docs/pushnotificationios.html) to set up push notifications in your app. 37 | 2. In `AppDelegate.m`: 38 | ```objective-c 39 | // Import 'RNNotificationActions.h' at top. 40 | #import "RNNotificationActions.h" 41 | 42 | // Add support for push notification actions (optional) 43 | - (void)application:(UIApplication *)application handleActionWithIdentifier:(nullable NSString *)identifier forLocalNotification:(nonnull UILocalNotification *)notification withResponseInfo:(nonnull NSDictionary *)responseInfo completionHandler:(nonnull void (^)())completionHandler 44 | { 45 | NSLog(@"got local notification!"); 46 | [RNNotificationActions application:application handleActionWithIdentifier:identifier forLocalNotification:notification withResponseInfo:responseInfo completionHandler:completionHandler]; 47 | } 48 | - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler 49 | { 50 | [RNNotificationActions application:application handleActionWithIdentifier:identifier forRemoteNotification:userInfo withResponseInfo:responseInfo completionHandler:completionHandler]; 51 | } 52 | ``` 53 | 54 | # Example 55 | ```javascript 56 | import NotificationActions from 'react-native-ios-notification-actions' 57 | 58 | // Create an "upvote" action that will display a button when a notification is swiped 59 | let upvoteButton = new NotificationActions.Action({ 60 | activationMode: 'background', 61 | title: 'Upvote', 62 | identifier: 'UPVOTE_ACTION' 63 | }, (res, done) => { 64 | console.info('upvote button pressed with result: ', res); 65 | done(); //important! 66 | }); 67 | 68 | // Create a "comment" button that will display a text input when the button is pressed 69 | let commentTextButton = new NotificationActions.Action({ 70 | activationMode: 'background', 71 | title: 'Reply', 72 | behavior: 'textInput', 73 | identifier: 'REPLY_ACTION' 74 | }, (res, done) => { 75 | console.info('reply typed via notification from source: ', res.source, ' with text: ', res.text); 76 | done(); //important! 77 | }); 78 | 79 | // Create a category containing our two actions 80 | let myCategory = new NotificationActions.Category({ 81 | identifier: 'something_happened', 82 | actions: [upvoteButton, commentTextButton], 83 | forContext: 'default' 84 | }); 85 | 86 | // ** important ** update the categories 87 | NotificationActions.updateCategories([myCategory]); 88 | ``` 89 | 90 | Then, when you present a local notification, you can simply use the same category name: 91 | ```javascript 92 | import {PushNotificationIOS} from 'react-native'; 93 | 94 | // Lock your screen before 5 seconds elapse! 95 | setTimeout(() => { 96 | console.info('presenting local notification!'); 97 | PushNotificationIOS.presentLocalNotification({ 98 | alertBody: 'This is a local notification!', 99 | category: 'something_happened' 100 | }); 101 | }, 5000); 102 | ``` 103 | 104 | The same goes for remote notifications - just include `{category: "your_category_name"}` in your push notification payload. 105 | 106 | # Action options 107 | 108 | * `title` - [String] Title for the action button [[apple doc]()] 109 | * `identifier` - [String] Identifier for the action. 110 | * `onComplete` - [function(responseData, completionHandler)] Called when the your app has been activated by the user interacting with this action. `responseData` contains inputted text if `behavior` is set to `textInput`. **Important** - you must call `completionHandler` when you are done handling the action. 111 | * `behavior` - [String] Custom behavior for the action [[apple doc](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIUserNotificationAction_class/index.html#//apple_ref/c/tdef/UIUserNotificationActionBehavior)] 112 | * `default` (default) - No additional behaviors 113 | * `textInput` - When tapped, this action opens a text input. On completion, the text is delivered to your `onComplete` callback. 114 | * `activationMode` - [String] What should iOS do with this app when this action is pressed? [[apple doc](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIUserNotificationAction_class/index.html#//apple_ref/c/tdef/UIUserNotificationActivationMode)] 115 | * `foreground` (default) - Bring the app into the foreground 116 | * `background` - Launch the app in the background 117 | * `authenticationRequired` - [Boolean] Should the user be required to unlock the device before the action is performed? [[apple doc](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIMutableUserNotificationAction_class/index.html#//apple_ref/occ/instp/UIMutableUserNotificationAction/authenticationRequired)] 118 | * `destructive` - [Boolean] If true, displays the action button differently (for example, colored red). [[apple doc](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIMutableUserNotificationAction_class/index.html#//apple_ref/occ/instp/UIMutableUserNotificationAction/destructive)] 119 | 120 | 121 | 122 | # Category options 123 | * `identifier` - [String] Identifier for the category. When creating a local or remote notification, use this value to associate this category with that notification. [[apple doc](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIMutableUserNotificationCategory_class/index.html#//apple_ref/occ/instp/UIMutableUserNotificationCategory/identifier)] 124 | * `actions` - [Array of `Action`s] The actions to display with this category. Maximum length depends on the value of the `context` property. [[apple doc](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIMutableUserNotificationCategory_class/index.html#//apple_ref/occ/instm/UIMutableUserNotificationCategory/setActions:forContext:)] 125 | * `context` - [String] Controls how many actions to display with a notification. [[apple doc](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIUserNotificationCategory_class/index.html#//apple_ref/c/tdef/UIUserNotificationActionContext)] 126 | * `default` (default) - Displays up to 4 actions. 127 | * `minimal` - Displays up to 2 actions. 128 | 129 | # TODO / help wanted 130 | * implement [action parameters](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIMutableUserNotificationAction_class/index.html#//apple_ref/occ/instp/UIMutableUserNotificationAction/parameters) 131 | * PR react-native to allow "category" key in local notification payloads (and maybe other keys as well) 132 | 133 | # More info 134 | [Nice overview of interactive notifications](https://nrj.io/simple-interactive-notifications-in-ios-8/) 135 | -------------------------------------------------------------------------------- /RNNotificationActions.podspec: -------------------------------------------------------------------------------- 1 | require 'json' 2 | version = JSON.parse(File.read('package.json'))["version"] 3 | 4 | Pod::Spec.new do |s| 5 | 6 | s.name = "RNNotificationActions" 7 | s.version = version 8 | s.summary = "Swipe + text input actions for ios push notifications." 9 | s.homepage = "https://github.com/holmesal/react-native-ios-notification-actions" 10 | s.license = "MIT" 11 | s.author = { "Alonso Holmes" => "hello@alonso.io" } 12 | s.platform = :ios, "8.0" 13 | s.source = { :git => "https://github.com/holmesal/react-native-ios-notification-actions.git", :tag => "v#{s.version}" } 14 | s.source_files = 'RNNotificationActions/*.{h,m}' 15 | s.preserve_paths = "**/*.js" 16 | s.dependency 'React' 17 | 18 | end 19 | -------------------------------------------------------------------------------- /RNNotificationActions/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/holmesal/react-native-ios-notification-actions/213a29f1691ff718af7bb623f7bc1ddd2da4b647/RNNotificationActions/.DS_Store -------------------------------------------------------------------------------- /RNNotificationActions/RNNotificationActions.h: -------------------------------------------------------------------------------- 1 | @import UIKit; 2 | 3 | #import 4 | 5 | @interface RNNotificationActions : NSObject 6 | 7 | + (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler; 8 | + (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler; 9 | 10 | @end -------------------------------------------------------------------------------- /RNNotificationActions/RNNotificationActions.m: -------------------------------------------------------------------------------- 1 | @import UIKit; 2 | #import "RNNotificationActions.h" 3 | #import "RNNotificationActionsManager.h" 4 | 5 | #import 6 | #import 7 | #import 8 | #import 9 | 10 | NSString *const RNNotificationActionReceived = @"NotificationActionReceived"; 11 | 12 | @implementation RCTConvert (UIUserNotificationActivationMode) 13 | RCT_ENUM_CONVERTER(UIUserNotificationActivationMode, ( 14 | @{ 15 | @"foreground": @(UIUserNotificationActivationModeForeground), 16 | @"background": @(UIUserNotificationActivationModeBackground), 17 | }), UIUserNotificationActivationModeForeground, integerValue) 18 | @end 19 | 20 | @implementation RCTConvert (UIUserNotificationActionBehavior) 21 | RCT_ENUM_CONVERTER(UIUserNotificationActionBehavior, ( 22 | @{ 23 | @"default": @(UIUserNotificationActionBehaviorDefault), 24 | @"textInput": @(UIUserNotificationActionBehaviorTextInput), 25 | }), UIUserNotificationActionBehaviorDefault, integerValue) 26 | @end 27 | 28 | @implementation RCTConvert (UIUserNotificationActionContext) 29 | RCT_ENUM_CONVERTER(UIUserNotificationActionContext, ( 30 | @{ 31 | @"default": @(UIUserNotificationActionContextDefault), 32 | @"minimal": @(UIUserNotificationActionContextMinimal), 33 | }), UIUserNotificationActionContextDefault, integerValue) 34 | @end 35 | 36 | @implementation RNNotificationActions 37 | 38 | RCT_EXPORT_MODULE(); 39 | 40 | @synthesize bridge = _bridge; 41 | 42 | - (id)init 43 | { 44 | if (self = [super init]) { 45 | return self; 46 | } else { 47 | return nil; 48 | } 49 | } 50 | 51 | - (void)dealloc 52 | { 53 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 54 | } 55 | 56 | - (void)setBridge:(RCTBridge *)bridge 57 | { 58 | _bridge = bridge; 59 | 60 | [[NSNotificationCenter defaultCenter] addObserver:self 61 | selector:@selector(handleNotificationActionReceived:) 62 | name:RNNotificationActionReceived 63 | object:nil]; 64 | NSDictionary *lastActionInfo = [RNNotificationActionsManager sharedInstance].lastActionInfo; 65 | if(lastActionInfo != nil) { 66 | [[NSNotificationCenter defaultCenter] postNotificationName:RNNotificationActionReceived 67 | object:self 68 | userInfo:lastActionInfo]; 69 | [RNNotificationActionsManager sharedInstance].lastActionInfo = nil; 70 | } 71 | } 72 | 73 | - (UIMutableUserNotificationAction *)actionFromJSON:(NSDictionary *)opts 74 | { 75 | UIMutableUserNotificationAction *action; 76 | action = [[UIMutableUserNotificationAction alloc] init]; 77 | [action setActivationMode: [RCTConvert UIUserNotificationActivationMode:opts[@"activationMode"]]]; 78 | [action setBehavior: [RCTConvert UIUserNotificationActionBehavior:opts[@"behavior"]]]; 79 | [action setTitle:opts[@"title"]]; 80 | [action setIdentifier:opts[@"identifier"]]; 81 | [action setDestructive:[RCTConvert BOOL:opts[@"destructive"]]]; 82 | [action setAuthenticationRequired:[RCTConvert BOOL:opts[@"authenticationRequired"]]]; 83 | return action; 84 | } 85 | 86 | - (UIUserNotificationCategory *)categoryFromJSON:(NSDictionary *)json 87 | { 88 | UIMutableUserNotificationCategory *category; 89 | category = [[UIMutableUserNotificationCategory alloc] init]; 90 | [category setIdentifier:[RCTConvert NSString:json[@"identifier"]]]; 91 | 92 | // Get the actions from the category 93 | NSMutableArray *actions; 94 | actions = [[NSMutableArray alloc] init]; 95 | for (NSDictionary *actionJSON in [RCTConvert NSArray:json[@"actions"]]) { 96 | [actions addObject:[self actionFromJSON:actionJSON]]; 97 | } 98 | 99 | // Set these actions for this context 100 | [category setActions:actions 101 | forContext:[RCTConvert UIUserNotificationActionContext:json[@"context"]]]; 102 | return category; 103 | } 104 | 105 | RCT_EXPORT_METHOD(updateCategories:(NSArray *)json) 106 | { 107 | NSMutableArray *categories = [[NSMutableArray alloc] init]; 108 | // Create the category 109 | for (NSDictionary *categoryJSON in json) { 110 | [categories addObject:[self categoryFromJSON:categoryJSON]]; 111 | } 112 | 113 | // Get the current types 114 | UIUserNotificationSettings *settings; 115 | UIUserNotificationType types = settings.types; 116 | 117 | // Update the settings for these types 118 | dispatch_async(dispatch_get_main_queue(), ^{ 119 | [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:types categories:[NSSet setWithArray:categories]]]; 120 | }); 121 | } 122 | 123 | RCT_EXPORT_METHOD(callCompletionHandler) 124 | { 125 | void (^completionHandler)() = [RNNotificationActionsManager sharedInstance].lastCompletionHandler; 126 | if(completionHandler != nil) { 127 | completionHandler(); 128 | [RNNotificationActionsManager sharedInstance].lastCompletionHandler = nil; 129 | } 130 | } 131 | 132 | 133 | // Handle notifications received by the app delegate and passed to the following class methods 134 | + (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forLocalNotification:(UILocalNotification *)notification withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler; 135 | { 136 | [self emitNotificationActionForIdentifier:identifier source:@"local" responseInfo:responseInfo userInfo:notification.userInfo completionHandler:completionHandler]; 137 | } 138 | 139 | + (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler 140 | { 141 | [self emitNotificationActionForIdentifier:identifier source:@"remote" responseInfo:responseInfo userInfo:userInfo completionHandler:completionHandler]; 142 | } 143 | 144 | + (void)emitNotificationActionForIdentifier:(NSString *)identifier source:(NSString *)source responseInfo:(NSDictionary *)responseInfo userInfo:(NSDictionary *)userInfo completionHandler:(void (^)())completionHandler 145 | { 146 | NSMutableDictionary *info = [[NSMutableDictionary alloc] initWithDictionary:@{ 147 | @"identifier": identifier, 148 | @"source": @"local" 149 | } 150 | ]; 151 | // Add text if present 152 | NSString *text = [responseInfo objectForKey:UIUserNotificationActionResponseTypedTextKey]; 153 | if (text != NULL) { 154 | info[@"text"] = text; 155 | } 156 | // Add userinfo if present 157 | if (userInfo != NULL) { 158 | info[@"userInfo"] = userInfo; 159 | } 160 | // Emit 161 | [[NSNotificationCenter defaultCenter] postNotificationName:RNNotificationActionReceived 162 | object:self 163 | userInfo:info]; 164 | [RNNotificationActionsManager sharedInstance].lastActionInfo = info; 165 | [RNNotificationActionsManager sharedInstance].lastCompletionHandler = completionHandler; 166 | } 167 | 168 | - (void)handleNotificationActionReceived:(NSNotification *)notification 169 | { 170 | [_bridge.eventDispatcher sendAppEventWithName:@"notificationActionReceived" 171 | body:notification.userInfo]; 172 | } 173 | 174 | + (BOOL)requiresMainQueueSetup 175 | { 176 | return YES; 177 | } 178 | 179 | @end -------------------------------------------------------------------------------- /RNNotificationActions/RNNotificationActions.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5D1251B41CB6130700A4BC7A /* RNNotificationActionsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 5D1251B31CB6130700A4BC7A /* RNNotificationActionsManager.m */; }; 11 | E2B7F23D1C36E76100945232 /* RNNotificationActions.m in Sources */ = {isa = PBXBuildFile; fileRef = E2B7F23C1C36E76100945232 /* RNNotificationActions.m */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXCopyFilesBuildPhase section */ 15 | E2B7F22D1C36E6D800945232 /* CopyFiles */ = { 16 | isa = PBXCopyFilesBuildPhase; 17 | buildActionMask = 2147483647; 18 | dstPath = "include/$(PRODUCT_NAME)"; 19 | dstSubfolderSpec = 16; 20 | files = ( 21 | ); 22 | runOnlyForDeploymentPostprocessing = 0; 23 | }; 24 | /* End PBXCopyFilesBuildPhase section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 5D1251B21CB6130700A4BC7A /* RNNotificationActionsManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNotificationActionsManager.h; sourceTree = SOURCE_ROOT; }; 28 | 5D1251B31CB6130700A4BC7A /* RNNotificationActionsManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNotificationActionsManager.m; sourceTree = SOURCE_ROOT; }; 29 | E2B7F22F1C36E6D800945232 /* libRNNotificationActions.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNNotificationActions.a; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | E2B7F23B1C36E76100945232 /* RNNotificationActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNNotificationActions.h; sourceTree = SOURCE_ROOT; }; 31 | E2B7F23C1C36E76100945232 /* RNNotificationActions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNNotificationActions.m; sourceTree = SOURCE_ROOT; }; 32 | /* End PBXFileReference section */ 33 | 34 | /* Begin PBXFrameworksBuildPhase section */ 35 | E2B7F22C1C36E6D800945232 /* Frameworks */ = { 36 | isa = PBXFrameworksBuildPhase; 37 | buildActionMask = 2147483647; 38 | files = ( 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | E2B7F2261C36E6D800945232 = { 46 | isa = PBXGroup; 47 | children = ( 48 | E2B7F2311C36E6D800945232 /* RNNotificationActions */, 49 | E2B7F2301C36E6D800945232 /* Products */, 50 | ); 51 | sourceTree = ""; 52 | }; 53 | E2B7F2301C36E6D800945232 /* Products */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | E2B7F22F1C36E6D800945232 /* libRNNotificationActions.a */, 57 | ); 58 | name = Products; 59 | sourceTree = ""; 60 | }; 61 | E2B7F2311C36E6D800945232 /* RNNotificationActions */ = { 62 | isa = PBXGroup; 63 | children = ( 64 | E2B7F23B1C36E76100945232 /* RNNotificationActions.h */, 65 | E2B7F23C1C36E76100945232 /* RNNotificationActions.m */, 66 | 5D1251B21CB6130700A4BC7A /* RNNotificationActionsManager.h */, 67 | 5D1251B31CB6130700A4BC7A /* RNNotificationActionsManager.m */, 68 | ); 69 | path = RNNotificationActions; 70 | sourceTree = ""; 71 | }; 72 | /* End PBXGroup section */ 73 | 74 | /* Begin PBXNativeTarget section */ 75 | E2B7F22E1C36E6D800945232 /* RNNotificationActions */ = { 76 | isa = PBXNativeTarget; 77 | buildConfigurationList = E2B7F2381C36E6D800945232 /* Build configuration list for PBXNativeTarget "RNNotificationActions" */; 78 | buildPhases = ( 79 | E2B7F22B1C36E6D800945232 /* Sources */, 80 | E2B7F22C1C36E6D800945232 /* Frameworks */, 81 | E2B7F22D1C36E6D800945232 /* CopyFiles */, 82 | ); 83 | buildRules = ( 84 | ); 85 | dependencies = ( 86 | ); 87 | name = RNNotificationActions; 88 | productName = RNNotificationActions; 89 | productReference = E2B7F22F1C36E6D800945232 /* libRNNotificationActions.a */; 90 | productType = "com.apple.product-type.library.static"; 91 | }; 92 | /* End PBXNativeTarget section */ 93 | 94 | /* Begin PBXProject section */ 95 | E2B7F2271C36E6D800945232 /* Project object */ = { 96 | isa = PBXProject; 97 | attributes = { 98 | LastUpgradeCheck = 0720; 99 | ORGANIZATIONNAME = "Alonso Holmes"; 100 | TargetAttributes = { 101 | E2B7F22E1C36E6D800945232 = { 102 | CreatedOnToolsVersion = 7.2; 103 | }; 104 | }; 105 | }; 106 | buildConfigurationList = E2B7F22A1C36E6D800945232 /* Build configuration list for PBXProject "RNNotificationActions" */; 107 | compatibilityVersion = "Xcode 3.2"; 108 | developmentRegion = English; 109 | hasScannedForEncodings = 0; 110 | knownRegions = ( 111 | en, 112 | ); 113 | mainGroup = E2B7F2261C36E6D800945232; 114 | productRefGroup = E2B7F2301C36E6D800945232 /* Products */; 115 | projectDirPath = ""; 116 | projectRoot = ""; 117 | targets = ( 118 | E2B7F22E1C36E6D800945232 /* RNNotificationActions */, 119 | ); 120 | }; 121 | /* End PBXProject section */ 122 | 123 | /* Begin PBXSourcesBuildPhase section */ 124 | E2B7F22B1C36E6D800945232 /* Sources */ = { 125 | isa = PBXSourcesBuildPhase; 126 | buildActionMask = 2147483647; 127 | files = ( 128 | 5D1251B41CB6130700A4BC7A /* RNNotificationActionsManager.m in Sources */, 129 | E2B7F23D1C36E76100945232 /* RNNotificationActions.m in Sources */, 130 | ); 131 | runOnlyForDeploymentPostprocessing = 0; 132 | }; 133 | /* End PBXSourcesBuildPhase section */ 134 | 135 | /* Begin XCBuildConfiguration section */ 136 | E2B7F2361C36E6D800945232 /* Debug */ = { 137 | isa = XCBuildConfiguration; 138 | buildSettings = { 139 | ALWAYS_SEARCH_USER_PATHS = NO; 140 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 141 | CLANG_CXX_LIBRARY = "libc++"; 142 | CLANG_ENABLE_MODULES = YES; 143 | CLANG_ENABLE_OBJC_ARC = YES; 144 | CLANG_WARN_BOOL_CONVERSION = YES; 145 | CLANG_WARN_CONSTANT_CONVERSION = YES; 146 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 147 | CLANG_WARN_EMPTY_BODY = YES; 148 | CLANG_WARN_ENUM_CONVERSION = YES; 149 | CLANG_WARN_INT_CONVERSION = YES; 150 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 151 | CLANG_WARN_UNREACHABLE_CODE = YES; 152 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 153 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 154 | COPY_PHASE_STRIP = NO; 155 | DEBUG_INFORMATION_FORMAT = dwarf; 156 | ENABLE_STRICT_OBJC_MSGSEND = YES; 157 | ENABLE_TESTABILITY = YES; 158 | GCC_C_LANGUAGE_STANDARD = gnu99; 159 | GCC_DYNAMIC_NO_PIC = NO; 160 | GCC_NO_COMMON_BLOCKS = YES; 161 | GCC_OPTIMIZATION_LEVEL = 0; 162 | GCC_PREPROCESSOR_DEFINITIONS = ( 163 | "DEBUG=1", 164 | "$(inherited)", 165 | ); 166 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 167 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 168 | GCC_WARN_UNDECLARED_SELECTOR = YES; 169 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 170 | GCC_WARN_UNUSED_FUNCTION = YES; 171 | GCC_WARN_UNUSED_VARIABLE = YES; 172 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 173 | MTL_ENABLE_DEBUG_INFO = YES; 174 | ONLY_ACTIVE_ARCH = YES; 175 | SDKROOT = iphoneos; 176 | }; 177 | name = Debug; 178 | }; 179 | E2B7F2371C36E6D800945232 /* Release */ = { 180 | isa = XCBuildConfiguration; 181 | buildSettings = { 182 | ALWAYS_SEARCH_USER_PATHS = NO; 183 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 184 | CLANG_CXX_LIBRARY = "libc++"; 185 | CLANG_ENABLE_MODULES = YES; 186 | CLANG_ENABLE_OBJC_ARC = YES; 187 | CLANG_WARN_BOOL_CONVERSION = YES; 188 | CLANG_WARN_CONSTANT_CONVERSION = YES; 189 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 190 | CLANG_WARN_EMPTY_BODY = YES; 191 | CLANG_WARN_ENUM_CONVERSION = YES; 192 | CLANG_WARN_INT_CONVERSION = YES; 193 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 194 | CLANG_WARN_UNREACHABLE_CODE = YES; 195 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 196 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 197 | COPY_PHASE_STRIP = YES; 198 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 199 | ENABLE_NS_ASSERTIONS = NO; 200 | ENABLE_STRICT_OBJC_MSGSEND = YES; 201 | GCC_C_LANGUAGE_STANDARD = gnu99; 202 | GCC_NO_COMMON_BLOCKS = YES; 203 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 204 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 205 | GCC_WARN_UNDECLARED_SELECTOR = YES; 206 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 207 | GCC_WARN_UNUSED_FUNCTION = YES; 208 | GCC_WARN_UNUSED_VARIABLE = YES; 209 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 210 | MTL_ENABLE_DEBUG_INFO = NO; 211 | SDKROOT = iphoneos; 212 | VALIDATE_PRODUCT = YES; 213 | }; 214 | name = Release; 215 | }; 216 | E2B7F2391C36E6D800945232 /* Debug */ = { 217 | isa = XCBuildConfiguration; 218 | buildSettings = { 219 | ALWAYS_SEARCH_USER_PATHS = YES; 220 | HEADER_SEARCH_PATHS = ( 221 | "$(SRCROOT)/../example/node_modules/react-native/React/**", 222 | "$(SRCROOT)/../node_modules/react-native/React/**", 223 | "$(SRCROOT)/../../react-native/React/**", 224 | "$(SRCROOT)/../../../React/**", 225 | ); 226 | OTHER_LDFLAGS = ( 227 | "-ObjC", 228 | "$(inherited)", 229 | ); 230 | PRODUCT_NAME = "$(TARGET_NAME)"; 231 | SKIP_INSTALL = YES; 232 | }; 233 | name = Debug; 234 | }; 235 | E2B7F23A1C36E6D800945232 /* Release */ = { 236 | isa = XCBuildConfiguration; 237 | buildSettings = { 238 | ALWAYS_SEARCH_USER_PATHS = YES; 239 | HEADER_SEARCH_PATHS = ( 240 | "$(SRCROOT)/../example/node_modules/react-native/React/**", 241 | "$(SRCROOT)/../node_modules/react-native/React/**", 242 | "$(SRCROOT)/../../react-native/React/**", 243 | "$(SRCROOT)/../../../React/**", 244 | ); 245 | OTHER_LDFLAGS = ( 246 | "-ObjC", 247 | "$(inherited)", 248 | ); 249 | PRODUCT_NAME = "$(TARGET_NAME)"; 250 | SKIP_INSTALL = YES; 251 | }; 252 | name = Release; 253 | }; 254 | /* End XCBuildConfiguration section */ 255 | 256 | /* Begin XCConfigurationList section */ 257 | E2B7F22A1C36E6D800945232 /* Build configuration list for PBXProject "RNNotificationActions" */ = { 258 | isa = XCConfigurationList; 259 | buildConfigurations = ( 260 | E2B7F2361C36E6D800945232 /* Debug */, 261 | E2B7F2371C36E6D800945232 /* Release */, 262 | ); 263 | defaultConfigurationIsVisible = 0; 264 | defaultConfigurationName = Release; 265 | }; 266 | E2B7F2381C36E6D800945232 /* Build configuration list for PBXNativeTarget "RNNotificationActions" */ = { 267 | isa = XCConfigurationList; 268 | buildConfigurations = ( 269 | E2B7F2391C36E6D800945232 /* Debug */, 270 | E2B7F23A1C36E6D800945232 /* Release */, 271 | ); 272 | defaultConfigurationIsVisible = 0; 273 | defaultConfigurationName = Release; 274 | }; 275 | /* End XCConfigurationList section */ 276 | }; 277 | rootObject = E2B7F2271C36E6D800945232 /* Project object */; 278 | } 279 | -------------------------------------------------------------------------------- /RNNotificationActions/RNNotificationActions.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /RNNotificationActions/RNNotificationActions.xcodeproj/project.xcworkspace/xcuserdata/alonso.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/holmesal/react-native-ios-notification-actions/213a29f1691ff718af7bb623f7bc1ddd2da4b647/RNNotificationActions/RNNotificationActions.xcodeproj/project.xcworkspace/xcuserdata/alonso.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /RNNotificationActions/RNNotificationActions.xcodeproj/xcuserdata/alonso.xcuserdatad/xcschemes/RNNotificationActions.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /RNNotificationActions/RNNotificationActions.xcodeproj/xcuserdata/alonso.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RNNotificationActions.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | E2B7F22E1C36E6D800945232 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /RNNotificationActions/RNNotificationActionsManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // RNNotificationActionsManager.h 3 | // 4 | // Created by Joel Arvidsson on 2016-04-06. 5 | // 6 | // 7 | 8 | #import 9 | 10 | @interface RNNotificationActionsManager : NSObject 11 | 12 | @property (nonatomic, retain) NSDictionary *lastActionInfo; 13 | @property (nonatomic, copy) void (^lastCompletionHandler)(); 14 | 15 | + (nonnull instancetype)sharedInstance; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /RNNotificationActions/RNNotificationActionsManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // RNNotificationActionsManager.m 3 | // 4 | // Created by Joel Arvidsson on 2016-04-06. 5 | // 6 | // 7 | 8 | #import "RNNotificationActionsManager.h" 9 | 10 | @implementation RNNotificationActionsManager 11 | 12 | + (nonnull instancetype)sharedInstance { 13 | static RNNotificationActionsManager *sharedInstance = nil; 14 | static dispatch_once_t onceToken; 15 | dispatch_once(&onceToken, ^{ 16 | sharedInstance = [self new]; 17 | }); 18 | return sharedInstance; 19 | } 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | project.xcworkspace 24 | 25 | # Android/IJ 26 | # 27 | .idea 28 | .gradle 29 | local.properties 30 | 31 | # node.js 32 | # 33 | node_modules/ 34 | npm-debug.log 35 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | /** 4 | * The react.gradle file registers two tasks: bundleDebugJsAndAssets and bundleReleaseJsAndAssets. 5 | * These basically call `react-native bundle` with the correct arguments during the Android build 6 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 7 | * bundle directly from the development server. Below you can see all the possible configurations 8 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 9 | * `apply from: "react.gradle"` line. 10 | * 11 | * project.ext.react = [ 12 | * // the name of the generated asset file containing your JS bundle 13 | * bundleAssetName: "index.android.bundle", 14 | * 15 | * // the entry file for bundle generation 16 | * entryFile: "index.android.js", 17 | * 18 | * // whether to bundle JS and assets in debug mode 19 | * bundleInDebug: false, 20 | * 21 | * // whether to bundle JS and assets in release mode 22 | * bundleInRelease: true, 23 | * 24 | * // the root of your project, i.e. where "package.json" lives 25 | * root: "../../", 26 | * 27 | * // where to put the JS bundle asset in debug mode 28 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 29 | * 30 | * // where to put the JS bundle asset in release mode 31 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 32 | * 33 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 34 | * // require('./image.png')), in debug mode 35 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 36 | * 37 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 38 | * // require('./image.png')), in release mode 39 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 40 | * 41 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 42 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 43 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 44 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 45 | * // for example, you might want to remove it from here. 46 | * inputExcludes: ["android/**", "ios/**"] 47 | * ] 48 | */ 49 | 50 | apply from: "react.gradle" 51 | 52 | android { 53 | compileSdkVersion 23 54 | buildToolsVersion "23.0.1" 55 | 56 | defaultConfig { 57 | applicationId "com.actionexamples" 58 | minSdkVersion 16 59 | targetSdkVersion 22 60 | versionCode 1 61 | versionName "1.0" 62 | ndk { 63 | abiFilters "armeabi-v7a", "x86" 64 | } 65 | } 66 | buildTypes { 67 | release { 68 | minifyEnabled false // Set this to true to enable Proguard 69 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 70 | } 71 | } 72 | } 73 | 74 | dependencies { 75 | compile fileTree(dir: "libs", include: ["*.jar"]) 76 | compile "com.android.support:appcompat-v7:23.0.1" 77 | compile "com.facebook.react:react-native:0.17.+" 78 | } 79 | -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Disabling obfuscation is useful if you collect stack traces from production crashes 20 | # (unless you are using a system that supports de-obfuscate the stack traces). 21 | -dontobfuscate 22 | 23 | # React Native 24 | 25 | # Keep our interfaces so they can be used by other ProGuard rules. 26 | # See http://sourceforge.net/p/proguard/bugs/466/ 27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip 28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters 29 | 30 | # Do not strip any method/class that is annotated with @DoNotStrip 31 | -keep @com.facebook.proguard.annotations.DoNotStrip class * 32 | -keepclassmembers class * { 33 | @com.facebook.proguard.annotations.DoNotStrip *; 34 | } 35 | 36 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { 37 | void set*(***); 38 | *** get*(); 39 | } 40 | 41 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; } 42 | -keep class * extends com.facebook.react.bridge.NativeModule { *; } 43 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; } 44 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactProp ; } 45 | -keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup ; } 46 | 47 | # okhttp 48 | 49 | -keepattributes Signature 50 | -keepattributes *Annotation* 51 | -keep class com.squareup.okhttp.** { *; } 52 | -keep interface com.squareup.okhttp.** { *; } 53 | -dontwarn com.squareup.okhttp.** 54 | 55 | # okio 56 | 57 | -keep class sun.misc.Unsafe { *; } 58 | -dontwarn java.nio.file.* 59 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement 60 | -dontwarn okio.** 61 | -------------------------------------------------------------------------------- /example/android/app/react.gradle: -------------------------------------------------------------------------------- 1 | import org.apache.tools.ant.taskdefs.condition.Os 2 | 3 | def config = project.hasProperty("react") ? project.react : []; 4 | 5 | def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" 6 | def entryFile = config.entryFile ?: "index.android.js" 7 | 8 | // because elvis operator 9 | def elvisFile(thing) { 10 | return thing ? file(thing) : null; 11 | } 12 | 13 | def reactRoot = elvisFile(config.root) ?: file("../../") 14 | def jsBundleDirDebug = elvisFile(config.jsBundleDirDebug) ?: 15 | file("$buildDir/intermediates/assets/debug") 16 | def jsBundleDirRelease = elvisFile(config.jsBundleDirRelease) ?: 17 | file("$buildDir/intermediates/assets/release") 18 | def resourcesDirDebug = elvisFile(config.resourcesDirDebug) ?: 19 | file("$buildDir/intermediates/res/merged/debug") 20 | def resourcesDirRelease = elvisFile(config.resourcesDirRelease) ?: 21 | file("$buildDir/intermediates/res/merged/release") 22 | def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"] 23 | 24 | def jsBundleFileDebug = file("$jsBundleDirDebug/$bundleAssetName") 25 | def jsBundleFileRelease = file("$jsBundleDirRelease/$bundleAssetName") 26 | 27 | task bundleDebugJsAndAssets(type: Exec) { 28 | // create dirs if they are not there (e.g. the "clean" task just ran) 29 | doFirst { 30 | jsBundleDirDebug.mkdirs() 31 | resourcesDirDebug.mkdirs() 32 | } 33 | 34 | // set up inputs and outputs so gradle can cache the result 35 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 36 | outputs.dir jsBundleDirDebug 37 | outputs.dir resourcesDirDebug 38 | 39 | // set up the call to the react-native cli 40 | workingDir reactRoot 41 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { 42 | commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", 43 | entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug 44 | } else { 45 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file", 46 | entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug 47 | } 48 | 49 | enabled config.bundleInDebug ?: false 50 | } 51 | 52 | task bundleReleaseJsAndAssets(type: Exec) { 53 | // create dirs if they are not there (e.g. the "clean" task just ran) 54 | doFirst { 55 | jsBundleDirRelease.mkdirs() 56 | resourcesDirRelease.mkdirs() 57 | } 58 | 59 | // set up inputs and outputs so gradle can cache the result 60 | inputs.files fileTree(dir: reactRoot, excludes: inputExcludes) 61 | outputs.dir jsBundleDirRelease 62 | outputs.dir resourcesDirRelease 63 | 64 | // set up the call to the react-native cli 65 | workingDir reactRoot 66 | if (Os.isFamily(Os.FAMILY_WINDOWS)) { 67 | commandLine "cmd","/c", "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", 68 | entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease 69 | } else { 70 | commandLine "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file", 71 | entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease 72 | } 73 | 74 | enabled config.bundleInRelease ?: true 75 | } 76 | 77 | gradle.projectsEvaluated { 78 | // hook bundleDebugJsAndAssets into the android build process 79 | bundleDebugJsAndAssets.dependsOn mergeDebugResources 80 | bundleDebugJsAndAssets.dependsOn mergeDebugAssets 81 | processDebugResources.dependsOn bundleDebugJsAndAssets 82 | 83 | // hook bundleReleaseJsAndAssets into the android build process 84 | bundleReleaseJsAndAssets.dependsOn mergeReleaseResources 85 | bundleReleaseJsAndAssets.dependsOn mergeReleaseAssets 86 | processReleaseResources.dependsOn bundleReleaseJsAndAssets 87 | } 88 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/actionexamples/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.actionexamples; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.KeyEvent; 6 | 7 | import com.facebook.react.LifecycleState; 8 | import com.facebook.react.ReactInstanceManager; 9 | import com.facebook.react.ReactRootView; 10 | import com.facebook.react.modules.core.DefaultHardwareBackBtnHandler; 11 | import com.facebook.react.shell.MainReactPackage; 12 | import com.facebook.soloader.SoLoader; 13 | 14 | public class MainActivity extends Activity implements DefaultHardwareBackBtnHandler { 15 | 16 | private ReactInstanceManager mReactInstanceManager; 17 | private ReactRootView mReactRootView; 18 | 19 | @Override 20 | protected void onCreate(Bundle savedInstanceState) { 21 | super.onCreate(savedInstanceState); 22 | mReactRootView = new ReactRootView(this); 23 | 24 | mReactInstanceManager = ReactInstanceManager.builder() 25 | .setApplication(getApplication()) 26 | .setBundleAssetName("index.android.bundle") 27 | .setJSMainModuleName("index.android") 28 | .addPackage(new MainReactPackage()) 29 | .setUseDeveloperSupport(BuildConfig.DEBUG) 30 | .setInitialLifecycleState(LifecycleState.RESUMED) 31 | .build(); 32 | 33 | mReactRootView.startReactApplication(mReactInstanceManager, "ActionExamples", null); 34 | 35 | setContentView(mReactRootView); 36 | } 37 | 38 | @Override 39 | public boolean onKeyUp(int keyCode, KeyEvent event) { 40 | if (keyCode == KeyEvent.KEYCODE_MENU && mReactInstanceManager != null) { 41 | mReactInstanceManager.showDevOptionsDialog(); 42 | return true; 43 | } 44 | return super.onKeyUp(keyCode, event); 45 | } 46 | 47 | @Override 48 | public void onBackPressed() { 49 | if (mReactInstanceManager != null) { 50 | mReactInstanceManager.onBackPressed(); 51 | } else { 52 | super.onBackPressed(); 53 | } 54 | } 55 | 56 | @Override 57 | public void invokeDefaultOnBackPressed() { 58 | super.onBackPressed(); 59 | } 60 | 61 | @Override 62 | protected void onPause() { 63 | super.onPause(); 64 | 65 | if (mReactInstanceManager != null) { 66 | mReactInstanceManager.onPause(); 67 | } 68 | } 69 | 70 | @Override 71 | protected void onResume() { 72 | super.onResume(); 73 | 74 | if (mReactInstanceManager != null) { 75 | mReactInstanceManager.onResume(this, this); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/holmesal/react-native-ios-notification-actions/213a29f1691ff718af7bb623f7bc1ddd2da4b647/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/holmesal/react-native-ios-notification-actions/213a29f1691ff718af7bb623f7bc1ddd2da4b647/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/holmesal/react-native-ios-notification-actions/213a29f1691ff718af7bb623f7bc1ddd2da4b647/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/holmesal/react-native-ios-notification-actions/213a29f1691ff718af7bb623f7bc1ddd2da4b647/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | ActionExamples 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:1.3.1' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | mavenLocal() 18 | jcenter() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useDeprecatedNdk=true 21 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/holmesal/react-native-ios-notification-actions/213a29f1691ff718af7bb623f7bc1ddd2da4b647/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'ActionExamples' 2 | 3 | include ':app' 4 | -------------------------------------------------------------------------------- /example/index.android.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 'use strict'; 6 | 7 | var React = require('react-native'); 8 | var { 9 | AppRegistry, 10 | StyleSheet, 11 | Text, 12 | View, 13 | } = React; 14 | 15 | var ActionExamples = React.createClass({ 16 | render: function() { 17 | return ( 18 | 19 | 20 | Welcome to React Native! 21 | 22 | 23 | To get started, edit index.android.js 24 | 25 | 26 | Shake or press menu button for dev menu 27 | 28 | 29 | ); 30 | } 31 | }); 32 | 33 | var styles = StyleSheet.create({ 34 | container: { 35 | flex: 1, 36 | justifyContent: 'center', 37 | alignItems: 'center', 38 | backgroundColor: '#F5FCFF', 39 | }, 40 | welcome: { 41 | fontSize: 20, 42 | textAlign: 'center', 43 | margin: 10, 44 | }, 45 | instructions: { 46 | textAlign: 'center', 47 | color: '#333333', 48 | marginBottom: 5, 49 | }, 50 | }); 51 | 52 | AppRegistry.registerComponent('ActionExamples', () => ActionExamples); 53 | -------------------------------------------------------------------------------- /example/index.ios.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | */ 5 | 6 | var React = require('react-native'); 7 | var { 8 | AppRegistry, 9 | PushNotificationIOS, 10 | StyleSheet, 11 | Text, 12 | View, 13 | } = React; 14 | var NotificationActions = require('react-native-ios-notification-actions'); 15 | 16 | var ActionExamples = React.createClass({ 17 | 18 | componentDidMount: function() { 19 | // Request push notification permissions 20 | PushNotificationIOS.requestPermissions(); 21 | 22 | // Create some actions and categories 23 | // Create an "upvote" action that will display a button when a notification is swiped 24 | let upvoteButton = new NotificationActions.Action({ 25 | activationMode: 'background', 26 | title: String.fromCodePoint(0x1F44D), 27 | //title: String.fromCodePoint(0x2764), 28 | //title: 'Fave', 29 | identifier: 'UPVOTE_ACTION' 30 | }, (res, done) => { 31 | console.info('upvote button pressed with result: ', res); 32 | console.info('source was: ', res.source); 33 | done(); //important! 34 | }); 35 | 36 | 37 | // Create a "comment" button that will display a text input when the button is pressed 38 | let commentTextButton = new NotificationActions.Action({ 39 | activationMode: 'background', 40 | title: String.fromCodePoint(0x1F4AC), 41 | //title: 'Comment', 42 | behavior: 'textInput', 43 | identifier: 'REPLY_ACTION' 44 | }, (res, done) => { 45 | console.info('reply typed via notification from source: ', res.source, ' with text: ', res.text); 46 | done(); //important! 47 | }); 48 | 49 | // Create a category containing our two actions 50 | let myCategory = new NotificationActions.Category({ 51 | identifier: 'something_happened', 52 | actions: [commentTextButton, upvoteButton], 53 | forContext: 'default' 54 | }); 55 | 56 | NotificationActions.updateCategories([myCategory]); 57 | 58 | setTimeout(() => { 59 | console.info('sending local notification!'); 60 | PushNotificationIOS.presentLocalNotification({alertBody: 'Slide to comment or like', category: 'something_happened', alertAction: 'comment or like'}); 61 | }, 4000) 62 | }, 63 | 64 | render: function() { 65 | return ( 66 | 67 | 68 | Welcome to React Native! 69 | 70 | 71 | To get started, edit index.ios.js 72 | 73 | 74 | Press Cmd+R to reload,{'\n'} 75 | Cmd+D or shake for dev menu 76 | 77 | 78 | ); 79 | } 80 | }); 81 | 82 | var styles = StyleSheet.create({ 83 | container: { 84 | flex: 1, 85 | justifyContent: 'center', 86 | alignItems: 'center', 87 | backgroundColor: '#F5FCFF', 88 | }, 89 | welcome: { 90 | fontSize: 20, 91 | textAlign: 'center', 92 | margin: 10, 93 | }, 94 | instructions: { 95 | textAlign: 'center', 96 | color: '#333333', 97 | marginBottom: 5, 98 | }, 99 | }); 100 | 101 | AppRegistry.registerComponent('ActionExamples', () => ActionExamples); 102 | -------------------------------------------------------------------------------- /example/ios/ActionExamples.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 11 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; 12 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; }; 13 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 14 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; 15 | 00E356F31AD99517003FC87E /* ActionExamplesTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* ActionExamplesTests.m */; }; 16 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 78C398B91ACF4ADC00677621 /* libRCTLinking.a */; }; 17 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */; }; 18 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */; }; 19 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; }; 20 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; }; 21 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 22 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 23 | 146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; }; 24 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; }; 25 | E2B7F2021C35ADB100945232 /* libRCTPushNotification.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E2B7F2011C35AD9500945232 /* libRCTPushNotification.a */; }; 26 | E2B7F2601C36EA6200945232 /* libRNNotificationActions.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E2B7F25F1C36EA5600945232 /* libRNNotificationActions.a */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 33 | proxyType = 2; 34 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 35 | remoteInfo = RCTActionSheet; 36 | }; 37 | 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 40 | proxyType = 2; 41 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 42 | remoteInfo = RCTGeolocation; 43 | }; 44 | 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */ = { 45 | isa = PBXContainerItemProxy; 46 | containerPortal = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 47 | proxyType = 2; 48 | remoteGlobalIDString = 58B5115D1A9E6B3D00147676; 49 | remoteInfo = RCTImage; 50 | }; 51 | 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */ = { 52 | isa = PBXContainerItemProxy; 53 | containerPortal = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 54 | proxyType = 2; 55 | remoteGlobalIDString = 58B511DB1A9E6C8500147676; 56 | remoteInfo = RCTNetwork; 57 | }; 58 | 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */ = { 59 | isa = PBXContainerItemProxy; 60 | containerPortal = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 61 | proxyType = 2; 62 | remoteGlobalIDString = 832C81801AAF6DEF007FA2F7; 63 | remoteInfo = RCTVibration; 64 | }; 65 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 66 | isa = PBXContainerItemProxy; 67 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 68 | proxyType = 1; 69 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 70 | remoteInfo = ActionExamples; 71 | }; 72 | 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */ = { 73 | isa = PBXContainerItemProxy; 74 | containerPortal = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 75 | proxyType = 2; 76 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 77 | remoteInfo = RCTSettings; 78 | }; 79 | 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */ = { 80 | isa = PBXContainerItemProxy; 81 | containerPortal = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 82 | proxyType = 2; 83 | remoteGlobalIDString = 3C86DF461ADF2C930047B81A; 84 | remoteInfo = RCTWebSocket; 85 | }; 86 | 146834031AC3E56700842450 /* PBXContainerItemProxy */ = { 87 | isa = PBXContainerItemProxy; 88 | containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */; 89 | proxyType = 2; 90 | remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192; 91 | remoteInfo = React; 92 | }; 93 | 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */ = { 94 | isa = PBXContainerItemProxy; 95 | containerPortal = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 96 | proxyType = 2; 97 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 98 | remoteInfo = RCTLinking; 99 | }; 100 | 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = { 101 | isa = PBXContainerItemProxy; 102 | containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 103 | proxyType = 2; 104 | remoteGlobalIDString = 58B5119B1A9E6C1200147676; 105 | remoteInfo = RCTText; 106 | }; 107 | E2B7F2001C35AD9500945232 /* PBXContainerItemProxy */ = { 108 | isa = PBXContainerItemProxy; 109 | containerPortal = E2B7F1FC1C35AD9500945232 /* RCTPushNotification.xcodeproj */; 110 | proxyType = 2; 111 | remoteGlobalIDString = 134814201AA4EA6300B7C361; 112 | remoteInfo = RCTPushNotification; 113 | }; 114 | E2B7F25E1C36EA5600945232 /* PBXContainerItemProxy */ = { 115 | isa = PBXContainerItemProxy; 116 | containerPortal = E2B7F24F1C36EA5600945232 /* RNNotificationActions.xcodeproj */; 117 | proxyType = 2; 118 | remoteGlobalIDString = E2B7F22F1C36E6D800945232; 119 | remoteInfo = RNNotificationActions; 120 | }; 121 | /* End PBXContainerItemProxy section */ 122 | 123 | /* Begin PBXFileReference section */ 124 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 125 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; 126 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTGeolocation.xcodeproj; path = "../node_modules/react-native/Libraries/Geolocation/RCTGeolocation.xcodeproj"; sourceTree = ""; }; 127 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = "../node_modules/react-native/Libraries/Image/RCTImage.xcodeproj"; sourceTree = ""; }; 128 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = "../node_modules/react-native/Libraries/Network/RCTNetwork.xcodeproj"; sourceTree = ""; }; 129 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTVibration.xcodeproj; path = "../node_modules/react-native/Libraries/Vibration/RCTVibration.xcodeproj"; sourceTree = ""; }; 130 | 00E356EE1AD99517003FC87E /* ActionExamplesTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ActionExamplesTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 131 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 132 | 00E356F21AD99517003FC87E /* ActionExamplesTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ActionExamplesTests.m; sourceTree = ""; }; 133 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = "../node_modules/react-native/Libraries/Settings/RCTSettings.xcodeproj"; sourceTree = ""; }; 134 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocket.xcodeproj; path = "../node_modules/react-native/Libraries/WebSocket/RCTWebSocket.xcodeproj"; sourceTree = ""; }; 135 | 13B07F961A680F5B00A75B9A /* ActionExamples.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ActionExamples.app; sourceTree = BUILT_PRODUCTS_DIR; }; 136 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = ActionExamples/AppDelegate.h; sourceTree = ""; }; 137 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = ActionExamples/AppDelegate.m; sourceTree = ""; }; 138 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 139 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = ActionExamples/Images.xcassets; sourceTree = ""; }; 140 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = ActionExamples/Info.plist; sourceTree = ""; }; 141 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = ActionExamples/main.m; sourceTree = ""; }; 142 | 146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = ""; }; 143 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = ""; }; 144 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = ""; }; 145 | E2B7F1FC1C35AD9500945232 /* RCTPushNotification.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTPushNotification.xcodeproj; path = "/Users/alonso/dev/react-native-ios-notification-actions/example/node_modules/react-native/Libraries/WebSocket/../PushNotificationIOS/RCTPushNotification.xcodeproj"; sourceTree = ""; }; 146 | E2B7F24F1C36EA5600945232 /* RNNotificationActions.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNNotificationActions.xcodeproj; path = ../../RNNotificationActions/RNNotificationActions.xcodeproj; sourceTree = ""; }; 147 | /* End PBXFileReference section */ 148 | 149 | /* Begin PBXFrameworksBuildPhase section */ 150 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 151 | isa = PBXFrameworksBuildPhase; 152 | buildActionMask = 2147483647; 153 | files = ( 154 | ); 155 | runOnlyForDeploymentPostprocessing = 0; 156 | }; 157 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 158 | isa = PBXFrameworksBuildPhase; 159 | buildActionMask = 2147483647; 160 | files = ( 161 | E2B7F2021C35ADB100945232 /* libRCTPushNotification.a in Frameworks */, 162 | 146834051AC3E58100842450 /* libReact.a in Frameworks */, 163 | 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 164 | 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, 165 | 00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */, 166 | 133E29F31AD74F7200F7D852 /* libRCTLinking.a in Frameworks */, 167 | 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */, 168 | 139105C61AF99C1200B5F7CC /* libRCTSettings.a in Frameworks */, 169 | 832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */, 170 | 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */, 171 | 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, 172 | E2B7F2601C36EA6200945232 /* libRNNotificationActions.a in Frameworks */, 173 | ); 174 | runOnlyForDeploymentPostprocessing = 0; 175 | }; 176 | /* End PBXFrameworksBuildPhase section */ 177 | 178 | /* Begin PBXGroup section */ 179 | 00C302A81ABCB8CE00DB3ED1 /* Products */ = { 180 | isa = PBXGroup; 181 | children = ( 182 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */, 183 | ); 184 | name = Products; 185 | sourceTree = ""; 186 | }; 187 | 00C302B61ABCB90400DB3ED1 /* Products */ = { 188 | isa = PBXGroup; 189 | children = ( 190 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */, 191 | ); 192 | name = Products; 193 | sourceTree = ""; 194 | }; 195 | 00C302BC1ABCB91800DB3ED1 /* Products */ = { 196 | isa = PBXGroup; 197 | children = ( 198 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */, 199 | ); 200 | name = Products; 201 | sourceTree = ""; 202 | }; 203 | 00C302D41ABCB9D200DB3ED1 /* Products */ = { 204 | isa = PBXGroup; 205 | children = ( 206 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */, 207 | ); 208 | name = Products; 209 | sourceTree = ""; 210 | }; 211 | 00C302E01ABCB9EE00DB3ED1 /* Products */ = { 212 | isa = PBXGroup; 213 | children = ( 214 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */, 215 | ); 216 | name = Products; 217 | sourceTree = ""; 218 | }; 219 | 00E356EF1AD99517003FC87E /* ActionExamplesTests */ = { 220 | isa = PBXGroup; 221 | children = ( 222 | 00E356F21AD99517003FC87E /* ActionExamplesTests.m */, 223 | 00E356F01AD99517003FC87E /* Supporting Files */, 224 | ); 225 | path = ActionExamplesTests; 226 | sourceTree = ""; 227 | }; 228 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 229 | isa = PBXGroup; 230 | children = ( 231 | 00E356F11AD99517003FC87E /* Info.plist */, 232 | ); 233 | name = "Supporting Files"; 234 | sourceTree = ""; 235 | }; 236 | 139105B71AF99BAD00B5F7CC /* Products */ = { 237 | isa = PBXGroup; 238 | children = ( 239 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */, 240 | ); 241 | name = Products; 242 | sourceTree = ""; 243 | }; 244 | 139FDEE71B06529A00C62182 /* Products */ = { 245 | isa = PBXGroup; 246 | children = ( 247 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */, 248 | ); 249 | name = Products; 250 | sourceTree = ""; 251 | }; 252 | 13B07FAE1A68108700A75B9A /* ActionExamples */ = { 253 | isa = PBXGroup; 254 | children = ( 255 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */, 256 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 257 | 13B07FB01A68108700A75B9A /* AppDelegate.m */, 258 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 259 | 13B07FB61A68108700A75B9A /* Info.plist */, 260 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */, 261 | 13B07FB71A68108700A75B9A /* main.m */, 262 | ); 263 | name = ActionExamples; 264 | sourceTree = ""; 265 | }; 266 | 146834001AC3E56700842450 /* Products */ = { 267 | isa = PBXGroup; 268 | children = ( 269 | 146834041AC3E56700842450 /* libReact.a */, 270 | ); 271 | name = Products; 272 | sourceTree = ""; 273 | }; 274 | 78C398B11ACF4ADC00677621 /* Products */ = { 275 | isa = PBXGroup; 276 | children = ( 277 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */, 278 | ); 279 | name = Products; 280 | sourceTree = ""; 281 | }; 282 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 283 | isa = PBXGroup; 284 | children = ( 285 | E2B7F24F1C36EA5600945232 /* RNNotificationActions.xcodeproj */, 286 | 146833FF1AC3E56700842450 /* React.xcodeproj */, 287 | 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, 288 | 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */, 289 | 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */, 290 | 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */, 291 | 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */, 292 | 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */, 293 | 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */, 294 | 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */, 295 | E2B7F1FC1C35AD9500945232 /* RCTPushNotification.xcodeproj */, 296 | 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, 297 | ); 298 | name = Libraries; 299 | sourceTree = ""; 300 | }; 301 | 832341B11AAA6A8300B99B32 /* Products */ = { 302 | isa = PBXGroup; 303 | children = ( 304 | 832341B51AAA6A8300B99B32 /* libRCTText.a */, 305 | ); 306 | name = Products; 307 | sourceTree = ""; 308 | }; 309 | 83CBB9F61A601CBA00E9B192 = { 310 | isa = PBXGroup; 311 | children = ( 312 | 13B07FAE1A68108700A75B9A /* ActionExamples */, 313 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 314 | 00E356EF1AD99517003FC87E /* ActionExamplesTests */, 315 | 83CBBA001A601CBA00E9B192 /* Products */, 316 | ); 317 | indentWidth = 2; 318 | sourceTree = ""; 319 | tabWidth = 2; 320 | }; 321 | 83CBBA001A601CBA00E9B192 /* Products */ = { 322 | isa = PBXGroup; 323 | children = ( 324 | 13B07F961A680F5B00A75B9A /* ActionExamples.app */, 325 | 00E356EE1AD99517003FC87E /* ActionExamplesTests.xctest */, 326 | ); 327 | name = Products; 328 | sourceTree = ""; 329 | }; 330 | E2B7F1FD1C35AD9500945232 /* Products */ = { 331 | isa = PBXGroup; 332 | children = ( 333 | E2B7F2011C35AD9500945232 /* libRCTPushNotification.a */, 334 | ); 335 | name = Products; 336 | sourceTree = ""; 337 | }; 338 | E2B7F2501C36EA5600945232 /* Products */ = { 339 | isa = PBXGroup; 340 | children = ( 341 | E2B7F25F1C36EA5600945232 /* libRNNotificationActions.a */, 342 | ); 343 | name = Products; 344 | sourceTree = ""; 345 | }; 346 | /* End PBXGroup section */ 347 | 348 | /* Begin PBXNativeTarget section */ 349 | 00E356ED1AD99517003FC87E /* ActionExamplesTests */ = { 350 | isa = PBXNativeTarget; 351 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ActionExamplesTests" */; 352 | buildPhases = ( 353 | 00E356EA1AD99517003FC87E /* Sources */, 354 | 00E356EB1AD99517003FC87E /* Frameworks */, 355 | 00E356EC1AD99517003FC87E /* Resources */, 356 | ); 357 | buildRules = ( 358 | ); 359 | dependencies = ( 360 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 361 | ); 362 | name = ActionExamplesTests; 363 | productName = ActionExamplesTests; 364 | productReference = 00E356EE1AD99517003FC87E /* ActionExamplesTests.xctest */; 365 | productType = "com.apple.product-type.bundle.unit-test"; 366 | }; 367 | 13B07F861A680F5B00A75B9A /* ActionExamples */ = { 368 | isa = PBXNativeTarget; 369 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ActionExamples" */; 370 | buildPhases = ( 371 | 13B07F871A680F5B00A75B9A /* Sources */, 372 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 373 | 13B07F8E1A680F5B00A75B9A /* Resources */, 374 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 375 | ); 376 | buildRules = ( 377 | ); 378 | dependencies = ( 379 | ); 380 | name = ActionExamples; 381 | productName = "Hello World"; 382 | productReference = 13B07F961A680F5B00A75B9A /* ActionExamples.app */; 383 | productType = "com.apple.product-type.application"; 384 | }; 385 | /* End PBXNativeTarget section */ 386 | 387 | /* Begin PBXProject section */ 388 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 389 | isa = PBXProject; 390 | attributes = { 391 | LastUpgradeCheck = 0610; 392 | ORGANIZATIONNAME = Facebook; 393 | TargetAttributes = { 394 | 00E356ED1AD99517003FC87E = { 395 | CreatedOnToolsVersion = 6.2; 396 | TestTargetID = 13B07F861A680F5B00A75B9A; 397 | }; 398 | 13B07F861A680F5B00A75B9A = { 399 | DevelopmentTeam = SQ4LKA86HJ; 400 | SystemCapabilities = { 401 | com.apple.Push = { 402 | enabled = 1; 403 | }; 404 | }; 405 | }; 406 | }; 407 | }; 408 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ActionExamples" */; 409 | compatibilityVersion = "Xcode 3.2"; 410 | developmentRegion = English; 411 | hasScannedForEncodings = 0; 412 | knownRegions = ( 413 | en, 414 | Base, 415 | ); 416 | mainGroup = 83CBB9F61A601CBA00E9B192; 417 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 418 | projectDirPath = ""; 419 | projectReferences = ( 420 | { 421 | ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; 422 | ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; 423 | }, 424 | { 425 | ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */; 426 | ProjectRef = 00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */; 427 | }, 428 | { 429 | ProductGroup = 00C302BC1ABCB91800DB3ED1 /* Products */; 430 | ProjectRef = 00C302BB1ABCB91800DB3ED1 /* RCTImage.xcodeproj */; 431 | }, 432 | { 433 | ProductGroup = 78C398B11ACF4ADC00677621 /* Products */; 434 | ProjectRef = 78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */; 435 | }, 436 | { 437 | ProductGroup = 00C302D41ABCB9D200DB3ED1 /* Products */; 438 | ProjectRef = 00C302D31ABCB9D200DB3ED1 /* RCTNetwork.xcodeproj */; 439 | }, 440 | { 441 | ProductGroup = E2B7F1FD1C35AD9500945232 /* Products */; 442 | ProjectRef = E2B7F1FC1C35AD9500945232 /* RCTPushNotification.xcodeproj */; 443 | }, 444 | { 445 | ProductGroup = 139105B71AF99BAD00B5F7CC /* Products */; 446 | ProjectRef = 139105B61AF99BAD00B5F7CC /* RCTSettings.xcodeproj */; 447 | }, 448 | { 449 | ProductGroup = 832341B11AAA6A8300B99B32 /* Products */; 450 | ProjectRef = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */; 451 | }, 452 | { 453 | ProductGroup = 00C302E01ABCB9EE00DB3ED1 /* Products */; 454 | ProjectRef = 00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */; 455 | }, 456 | { 457 | ProductGroup = 139FDEE71B06529A00C62182 /* Products */; 458 | ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */; 459 | }, 460 | { 461 | ProductGroup = 146834001AC3E56700842450 /* Products */; 462 | ProjectRef = 146833FF1AC3E56700842450 /* React.xcodeproj */; 463 | }, 464 | { 465 | ProductGroup = E2B7F2501C36EA5600945232 /* Products */; 466 | ProjectRef = E2B7F24F1C36EA5600945232 /* RNNotificationActions.xcodeproj */; 467 | }, 468 | ); 469 | projectRoot = ""; 470 | targets = ( 471 | 13B07F861A680F5B00A75B9A /* ActionExamples */, 472 | 00E356ED1AD99517003FC87E /* ActionExamplesTests */, 473 | ); 474 | }; 475 | /* End PBXProject section */ 476 | 477 | /* Begin PBXReferenceProxy section */ 478 | 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */ = { 479 | isa = PBXReferenceProxy; 480 | fileType = archive.ar; 481 | path = libRCTActionSheet.a; 482 | remoteRef = 00C302AB1ABCB8CE00DB3ED1 /* PBXContainerItemProxy */; 483 | sourceTree = BUILT_PRODUCTS_DIR; 484 | }; 485 | 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */ = { 486 | isa = PBXReferenceProxy; 487 | fileType = archive.ar; 488 | path = libRCTGeolocation.a; 489 | remoteRef = 00C302B91ABCB90400DB3ED1 /* PBXContainerItemProxy */; 490 | sourceTree = BUILT_PRODUCTS_DIR; 491 | }; 492 | 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */ = { 493 | isa = PBXReferenceProxy; 494 | fileType = archive.ar; 495 | path = libRCTImage.a; 496 | remoteRef = 00C302BF1ABCB91800DB3ED1 /* PBXContainerItemProxy */; 497 | sourceTree = BUILT_PRODUCTS_DIR; 498 | }; 499 | 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */ = { 500 | isa = PBXReferenceProxy; 501 | fileType = archive.ar; 502 | path = libRCTNetwork.a; 503 | remoteRef = 00C302DB1ABCB9D200DB3ED1 /* PBXContainerItemProxy */; 504 | sourceTree = BUILT_PRODUCTS_DIR; 505 | }; 506 | 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */ = { 507 | isa = PBXReferenceProxy; 508 | fileType = archive.ar; 509 | path = libRCTVibration.a; 510 | remoteRef = 00C302E31ABCB9EE00DB3ED1 /* PBXContainerItemProxy */; 511 | sourceTree = BUILT_PRODUCTS_DIR; 512 | }; 513 | 139105C11AF99BAD00B5F7CC /* libRCTSettings.a */ = { 514 | isa = PBXReferenceProxy; 515 | fileType = archive.ar; 516 | path = libRCTSettings.a; 517 | remoteRef = 139105C01AF99BAD00B5F7CC /* PBXContainerItemProxy */; 518 | sourceTree = BUILT_PRODUCTS_DIR; 519 | }; 520 | 139FDEF41B06529B00C62182 /* libRCTWebSocket.a */ = { 521 | isa = PBXReferenceProxy; 522 | fileType = archive.ar; 523 | path = libRCTWebSocket.a; 524 | remoteRef = 139FDEF31B06529B00C62182 /* PBXContainerItemProxy */; 525 | sourceTree = BUILT_PRODUCTS_DIR; 526 | }; 527 | 146834041AC3E56700842450 /* libReact.a */ = { 528 | isa = PBXReferenceProxy; 529 | fileType = archive.ar; 530 | path = libReact.a; 531 | remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */; 532 | sourceTree = BUILT_PRODUCTS_DIR; 533 | }; 534 | 78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = { 535 | isa = PBXReferenceProxy; 536 | fileType = archive.ar; 537 | path = libRCTLinking.a; 538 | remoteRef = 78C398B81ACF4ADC00677621 /* PBXContainerItemProxy */; 539 | sourceTree = BUILT_PRODUCTS_DIR; 540 | }; 541 | 832341B51AAA6A8300B99B32 /* libRCTText.a */ = { 542 | isa = PBXReferenceProxy; 543 | fileType = archive.ar; 544 | path = libRCTText.a; 545 | remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */; 546 | sourceTree = BUILT_PRODUCTS_DIR; 547 | }; 548 | E2B7F2011C35AD9500945232 /* libRCTPushNotification.a */ = { 549 | isa = PBXReferenceProxy; 550 | fileType = archive.ar; 551 | path = libRCTPushNotification.a; 552 | remoteRef = E2B7F2001C35AD9500945232 /* PBXContainerItemProxy */; 553 | sourceTree = BUILT_PRODUCTS_DIR; 554 | }; 555 | E2B7F25F1C36EA5600945232 /* libRNNotificationActions.a */ = { 556 | isa = PBXReferenceProxy; 557 | fileType = archive.ar; 558 | path = libRNNotificationActions.a; 559 | remoteRef = E2B7F25E1C36EA5600945232 /* PBXContainerItemProxy */; 560 | sourceTree = BUILT_PRODUCTS_DIR; 561 | }; 562 | /* End PBXReferenceProxy section */ 563 | 564 | /* Begin PBXResourcesBuildPhase section */ 565 | 00E356EC1AD99517003FC87E /* Resources */ = { 566 | isa = PBXResourcesBuildPhase; 567 | buildActionMask = 2147483647; 568 | files = ( 569 | ); 570 | runOnlyForDeploymentPostprocessing = 0; 571 | }; 572 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 573 | isa = PBXResourcesBuildPhase; 574 | buildActionMask = 2147483647; 575 | files = ( 576 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 577 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */, 578 | ); 579 | runOnlyForDeploymentPostprocessing = 0; 580 | }; 581 | /* End PBXResourcesBuildPhase section */ 582 | 583 | /* Begin PBXShellScriptBuildPhase section */ 584 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 585 | isa = PBXShellScriptBuildPhase; 586 | buildActionMask = 2147483647; 587 | files = ( 588 | ); 589 | inputPaths = ( 590 | ); 591 | name = "Bundle React Native code and images"; 592 | outputPaths = ( 593 | ); 594 | runOnlyForDeploymentPostprocessing = 0; 595 | shellPath = /bin/sh; 596 | shellScript = "../node_modules/react-native/packager/react-native-xcode.sh"; 597 | }; 598 | /* End PBXShellScriptBuildPhase section */ 599 | 600 | /* Begin PBXSourcesBuildPhase section */ 601 | 00E356EA1AD99517003FC87E /* Sources */ = { 602 | isa = PBXSourcesBuildPhase; 603 | buildActionMask = 2147483647; 604 | files = ( 605 | 00E356F31AD99517003FC87E /* ActionExamplesTests.m in Sources */, 606 | ); 607 | runOnlyForDeploymentPostprocessing = 0; 608 | }; 609 | 13B07F871A680F5B00A75B9A /* Sources */ = { 610 | isa = PBXSourcesBuildPhase; 611 | buildActionMask = 2147483647; 612 | files = ( 613 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */, 614 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 615 | ); 616 | runOnlyForDeploymentPostprocessing = 0; 617 | }; 618 | /* End PBXSourcesBuildPhase section */ 619 | 620 | /* Begin PBXTargetDependency section */ 621 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 622 | isa = PBXTargetDependency; 623 | target = 13B07F861A680F5B00A75B9A /* ActionExamples */; 624 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 625 | }; 626 | /* End PBXTargetDependency section */ 627 | 628 | /* Begin PBXVariantGroup section */ 629 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = { 630 | isa = PBXVariantGroup; 631 | children = ( 632 | 13B07FB21A68108700A75B9A /* Base */, 633 | ); 634 | name = LaunchScreen.xib; 635 | path = ActionExamples; 636 | sourceTree = ""; 637 | }; 638 | /* End PBXVariantGroup section */ 639 | 640 | /* Begin XCBuildConfiguration section */ 641 | 00E356F61AD99517003FC87E /* Debug */ = { 642 | isa = XCBuildConfiguration; 643 | buildSettings = { 644 | BUNDLE_LOADER = "$(TEST_HOST)"; 645 | FRAMEWORK_SEARCH_PATHS = ( 646 | "$(SDKROOT)/Developer/Library/Frameworks", 647 | "$(inherited)", 648 | ); 649 | GCC_PREPROCESSOR_DEFINITIONS = ( 650 | "DEBUG=1", 651 | "$(inherited)", 652 | ); 653 | INFOPLIST_FILE = ActionExamplesTests/Info.plist; 654 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 655 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 656 | PRODUCT_NAME = "$(TARGET_NAME)"; 657 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ActionExamples.app/ActionExamples"; 658 | }; 659 | name = Debug; 660 | }; 661 | 00E356F71AD99517003FC87E /* Release */ = { 662 | isa = XCBuildConfiguration; 663 | buildSettings = { 664 | BUNDLE_LOADER = "$(TEST_HOST)"; 665 | COPY_PHASE_STRIP = NO; 666 | FRAMEWORK_SEARCH_PATHS = ( 667 | "$(SDKROOT)/Developer/Library/Frameworks", 668 | "$(inherited)", 669 | ); 670 | INFOPLIST_FILE = ActionExamplesTests/Info.plist; 671 | IPHONEOS_DEPLOYMENT_TARGET = 8.2; 672 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 673 | PRODUCT_NAME = "$(TARGET_NAME)"; 674 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/ActionExamples.app/ActionExamples"; 675 | }; 676 | name = Release; 677 | }; 678 | 13B07F941A680F5B00A75B9A /* Debug */ = { 679 | isa = XCBuildConfiguration; 680 | buildSettings = { 681 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 682 | CODE_SIGN_IDENTITY = "iPhone Developer"; 683 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 684 | DEAD_CODE_STRIPPING = NO; 685 | HEADER_SEARCH_PATHS = ( 686 | "$(inherited)", 687 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 688 | "$(SRCROOT)/../node_modules/react-native/React/**", 689 | "$(SRCROOT)/../node_modules/react-native/Libraries/PushNotificationIOS", 690 | "$(SRCROOT)/../../RNNotificationActions/**", 691 | ); 692 | INFOPLIST_FILE = ActionExamples/Info.plist; 693 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 694 | OTHER_LDFLAGS = ( 695 | "-ObjC", 696 | "$(inherited)", 697 | ); 698 | PRODUCT_NAME = ActionExamples; 699 | PROVISIONING_PROFILE = ""; 700 | }; 701 | name = Debug; 702 | }; 703 | 13B07F951A680F5B00A75B9A /* Release */ = { 704 | isa = XCBuildConfiguration; 705 | buildSettings = { 706 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 707 | CODE_SIGN_IDENTITY = "iPhone Developer"; 708 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 709 | HEADER_SEARCH_PATHS = ( 710 | "$(inherited)", 711 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 712 | "$(SRCROOT)/../node_modules/react-native/React/**", 713 | "$(SRCROOT)/../node_modules/react-native/Libraries/PushNotificationIOS", 714 | "$(SRCROOT)/../../RNNotificationActions/**", 715 | ); 716 | INFOPLIST_FILE = ActionExamples/Info.plist; 717 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 718 | OTHER_LDFLAGS = ( 719 | "-ObjC", 720 | "$(inherited)", 721 | ); 722 | PRODUCT_NAME = ActionExamples; 723 | PROVISIONING_PROFILE = ""; 724 | }; 725 | name = Release; 726 | }; 727 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 728 | isa = XCBuildConfiguration; 729 | buildSettings = { 730 | ALWAYS_SEARCH_USER_PATHS = NO; 731 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 732 | CLANG_CXX_LIBRARY = "libc++"; 733 | CLANG_ENABLE_MODULES = YES; 734 | CLANG_ENABLE_OBJC_ARC = YES; 735 | CLANG_WARN_BOOL_CONVERSION = YES; 736 | CLANG_WARN_CONSTANT_CONVERSION = YES; 737 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 738 | CLANG_WARN_EMPTY_BODY = YES; 739 | CLANG_WARN_ENUM_CONVERSION = YES; 740 | CLANG_WARN_INT_CONVERSION = YES; 741 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 742 | CLANG_WARN_UNREACHABLE_CODE = YES; 743 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 744 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 745 | COPY_PHASE_STRIP = NO; 746 | ENABLE_STRICT_OBJC_MSGSEND = YES; 747 | GCC_C_LANGUAGE_STANDARD = gnu99; 748 | GCC_DYNAMIC_NO_PIC = NO; 749 | GCC_OPTIMIZATION_LEVEL = 0; 750 | GCC_PREPROCESSOR_DEFINITIONS = ( 751 | "DEBUG=1", 752 | "$(inherited)", 753 | ); 754 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 755 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 756 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 757 | GCC_WARN_UNDECLARED_SELECTOR = YES; 758 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 759 | GCC_WARN_UNUSED_FUNCTION = YES; 760 | GCC_WARN_UNUSED_VARIABLE = YES; 761 | HEADER_SEARCH_PATHS = ( 762 | "$(inherited)", 763 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 764 | "$(SRCROOT)/../node_modules/react-native/React/**", 765 | "$(SRCROOT)/../../RNNotificationActions/**", 766 | ); 767 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 768 | MTL_ENABLE_DEBUG_INFO = YES; 769 | ONLY_ACTIVE_ARCH = YES; 770 | SDKROOT = iphoneos; 771 | }; 772 | name = Debug; 773 | }; 774 | 83CBBA211A601CBA00E9B192 /* Release */ = { 775 | isa = XCBuildConfiguration; 776 | buildSettings = { 777 | ALWAYS_SEARCH_USER_PATHS = NO; 778 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 779 | CLANG_CXX_LIBRARY = "libc++"; 780 | CLANG_ENABLE_MODULES = YES; 781 | CLANG_ENABLE_OBJC_ARC = YES; 782 | CLANG_WARN_BOOL_CONVERSION = YES; 783 | CLANG_WARN_CONSTANT_CONVERSION = YES; 784 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 785 | CLANG_WARN_EMPTY_BODY = YES; 786 | CLANG_WARN_ENUM_CONVERSION = YES; 787 | CLANG_WARN_INT_CONVERSION = YES; 788 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 789 | CLANG_WARN_UNREACHABLE_CODE = YES; 790 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 791 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 792 | COPY_PHASE_STRIP = YES; 793 | ENABLE_NS_ASSERTIONS = NO; 794 | ENABLE_STRICT_OBJC_MSGSEND = YES; 795 | GCC_C_LANGUAGE_STANDARD = gnu99; 796 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 797 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 798 | GCC_WARN_UNDECLARED_SELECTOR = YES; 799 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 800 | GCC_WARN_UNUSED_FUNCTION = YES; 801 | GCC_WARN_UNUSED_VARIABLE = YES; 802 | HEADER_SEARCH_PATHS = ( 803 | "$(inherited)", 804 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 805 | "$(SRCROOT)/../node_modules/react-native/React/**", 806 | "$(SRCROOT)/../../RNNotificationActions/**", 807 | ); 808 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 809 | MTL_ENABLE_DEBUG_INFO = NO; 810 | SDKROOT = iphoneos; 811 | VALIDATE_PRODUCT = YES; 812 | }; 813 | name = Release; 814 | }; 815 | /* End XCBuildConfiguration section */ 816 | 817 | /* Begin XCConfigurationList section */ 818 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "ActionExamplesTests" */ = { 819 | isa = XCConfigurationList; 820 | buildConfigurations = ( 821 | 00E356F61AD99517003FC87E /* Debug */, 822 | 00E356F71AD99517003FC87E /* Release */, 823 | ); 824 | defaultConfigurationIsVisible = 0; 825 | defaultConfigurationName = Release; 826 | }; 827 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "ActionExamples" */ = { 828 | isa = XCConfigurationList; 829 | buildConfigurations = ( 830 | 13B07F941A680F5B00A75B9A /* Debug */, 831 | 13B07F951A680F5B00A75B9A /* Release */, 832 | ); 833 | defaultConfigurationIsVisible = 0; 834 | defaultConfigurationName = Release; 835 | }; 836 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "ActionExamples" */ = { 837 | isa = XCConfigurationList; 838 | buildConfigurations = ( 839 | 83CBBA201A601CBA00E9B192 /* Debug */, 840 | 83CBBA211A601CBA00E9B192 /* Release */, 841 | ); 842 | defaultConfigurationIsVisible = 0; 843 | defaultConfigurationName = Release; 844 | }; 845 | /* End XCConfigurationList section */ 846 | }; 847 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 848 | } 849 | -------------------------------------------------------------------------------- /example/ios/ActionExamples.xcodeproj/xcshareddata/xcschemes/ActionExamples.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /example/ios/ActionExamples/AppDelegate.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (nonatomic, strong) UIWindow *window; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /example/ios/ActionExamples/AppDelegate.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "AppDelegate.h" 11 | 12 | #import "RCTRootView.h" 13 | #import "RCTPushNotificationManager.h" 14 | #import "RNNotificationActions.h" 15 | 16 | @implementation AppDelegate 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 19 | { 20 | NSURL *jsCodeLocation; 21 | 22 | /** 23 | * Loading JavaScript code - uncomment the one you want. 24 | * 25 | * OPTION 1 26 | * Load from development server. Start the server from the repository root: 27 | * 28 | * $ npm start 29 | * 30 | * To run on device, change `localhost` to the IP address of your computer 31 | * (you can get this by typing `ifconfig` into the terminal and selecting the 32 | * `inet` value under `en0:`) and make sure your computer and iOS device are 33 | * on the same Wi-Fi network. 34 | */ 35 | 36 | jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"]; 37 | 38 | /** 39 | * OPTION 2 40 | * Load from pre-bundled file on disk. The static bundle is automatically 41 | * generated by "Bundle React Native code and images" build step. 42 | */ 43 | 44 | // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 45 | 46 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation 47 | moduleName:@"ActionExamples" 48 | initialProperties:nil 49 | launchOptions:launchOptions]; 50 | 51 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 52 | UIViewController *rootViewController = [UIViewController new]; 53 | rootViewController.view = rootView; 54 | self.window.rootViewController = rootViewController; 55 | [self.window makeKeyAndVisible]; 56 | return YES; 57 | } 58 | 59 | // Required for the register event. 60 | - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken 61 | { 62 | [RCTPushNotificationManager application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken]; 63 | } 64 | // Required for the notification event. 65 | - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification 66 | { 67 | [RCTPushNotificationManager application:application didReceiveRemoteNotification:notification]; 68 | } 69 | // Required for the notification actions. 70 | - (void)application:(UIApplication *)application handleActionWithIdentifier:(nullable NSString *)identifier forLocalNotification:(nonnull UILocalNotification *)notification withResponseInfo:(nonnull NSDictionary *)responseInfo completionHandler:(nonnull void (^)())completionHandler 71 | { 72 | NSLog(@"got local notification!"); 73 | [RNNotificationActions application:application handleActionWithIdentifier:identifier forLocalNotification:notification withResponseInfo:responseInfo completionHandler:completionHandler]; 74 | } 75 | - (void)application:(UIApplication *)application handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:(NSDictionary *)userInfo withResponseInfo:(NSDictionary *)responseInfo completionHandler:(void (^)())completionHandler 76 | { 77 | [RNNotificationActions application:application handleActionWithIdentifier:identifier forRemoteNotification:userInfo withResponseInfo:responseInfo completionHandler:completionHandler]; 78 | } 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /example/ios/ActionExamples/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /example/ios/ActionExamples/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /example/ios/ActionExamples/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UIViewControllerBasedStatusBarAppearance 38 | 39 | NSLocationWhenInUseUsageDescription 40 | 41 | NSAppTransportSecurity 42 | 43 | 44 | NSAllowsArbitraryLoads 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /example/ios/ActionExamples/main.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "AppDelegate.h" 13 | 14 | int main(int argc, char * argv[]) { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /example/ios/ActionExamplesTests/ActionExamplesTests.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2015-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | #import 12 | 13 | #import "RCTLog.h" 14 | #import "RCTRootView.h" 15 | 16 | #define TIMEOUT_SECONDS 240 17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!" 18 | 19 | @interface ActionExamplesTests : XCTestCase 20 | 21 | @end 22 | 23 | @implementation ActionExamplesTests 24 | 25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 26 | { 27 | if (test(view)) { 28 | return YES; 29 | } 30 | for (UIView *subview in [view subviews]) { 31 | if ([self findSubviewInView:subview matching:test]) { 32 | return YES; 33 | } 34 | } 35 | return NO; 36 | } 37 | 38 | - (void)testRendersWelcomeScreen 39 | { 40 | UIViewController *vc = [[[[UIApplication sharedApplication] delegate] window] rootViewController]; 41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 42 | BOOL foundElement = NO; 43 | 44 | __block NSString *redboxError = nil; 45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 46 | if (level >= RCTLogLevelError) { 47 | redboxError = message; 48 | } 49 | }); 50 | 51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 54 | 55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 57 | return YES; 58 | } 59 | return NO; 60 | }]; 61 | } 62 | 63 | RCTSetLogFunction(RCTDefaultLogFunction); 64 | 65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /example/ios/ActionExamplesTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ActionExamples", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "start": "react-native start" 7 | }, 8 | "dependencies": { 9 | "react-native": "^0.17.0", 10 | "react-native-ios-notification-actions": "../" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /index.ios.js: -------------------------------------------------------------------------------- 1 | import { NativeModules, NativeAppEventEmitter } from 'react-native'; 2 | const { RNNotificationActions } = NativeModules; 3 | 4 | let actions = {}; 5 | 6 | function handleActionCompleted() { 7 | RNNotificationActions.callCompletionHandler(); 8 | }; 9 | 10 | export class Action { 11 | 12 | constructor(opts, onComplete) { 13 | // TODO - check options 14 | this.opts = opts; 15 | this.onComplete = onComplete; 16 | // When a notification is received, we'll call this action by it's identifier 17 | actions[opts.identifier] = this; 18 | NativeAppEventEmitter.addListener('notificationActionReceived', (body) => { 19 | if (body.identifier === opts.identifier) { 20 | onComplete(body, handleActionCompleted); 21 | } 22 | }); 23 | } 24 | } 25 | 26 | export class Category { 27 | 28 | constructor(opts) { 29 | // TODO - check options 30 | this.opts = opts; 31 | } 32 | 33 | } 34 | 35 | export const updateCategories = (categories) => { 36 | let cats = categories.map((cat) => { 37 | return Object.assign({}, cat.opts, { 38 | actions: cat.opts.actions.map((action) => action.opts) 39 | }); 40 | }); 41 | 42 | RNNotificationActions.updateCategories(cats); 43 | // Re-update when permissions change 44 | NativeAppEventEmitter.addListener('remoteNotificationsRegistered', () => { 45 | RNNotificationActions.updateCategories(cats); 46 | }); 47 | }; 48 | 49 | 50 | export default { 51 | Action, 52 | Category, 53 | updateCategories 54 | }; 55 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-ios-notification-actions", 3 | "version": "1.0.0", 4 | "description": "Swipe + text input actions for ios push notifications", 5 | "main": "index.ios.js", 6 | "directories": { 7 | "example": "example" 8 | }, 9 | "scripts": { 10 | "test": "echo \"Error: no test specified\" && exit 1" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/holmesal/react-native-ios-notification-actions.git" 15 | }, 16 | "keywords": [ 17 | "react-component", 18 | "react-native", 19 | "ios" 20 | ], 21 | "author": "Alonso Holmes ", 22 | "license": "MIT", 23 | "bugs": { 24 | "url": "https://github.com/holmesal/react-native-ios-notification-actions/issues" 25 | }, 26 | "homepage": "https://github.com/holmesal/react-native-ios-notification-actions#readme" 27 | } 28 | --------------------------------------------------------------------------------