├── LICENSE ├── README.md ├── RNSpeechToTextIos.podspec ├── baner.png ├── index.js ├── ios ├── RNSpeechToTextIos.h ├── RNSpeechToTextIos.m └── RNSpeechToTextIos.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── muhaos.xcuserdatad │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ └── muhaos.xcuserdatad │ └── xcschemes │ ├── RNSpeechToTextIos.xcscheme │ └── xcschememanagement.plist └── package.json /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Volodymyr Musiienko 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![alt tag](https://github.com/muhaos/react-native-speech-to-text-ios/blob/master/baner.png) 2 | 3 | # react-native-speech-to-text-ios [![npm version](https://img.shields.io/npm/v/react-native-maps.svg?style=flat)](https://www.npmjs.com/package/react-native-speech-to-text-ios) 4 | 5 | React Native speech recognition component for iOS 10+ 6 | 7 | ## Getting started 8 | 9 | `$ npm install react-native-speech-to-text-ios --save` 10 | 11 | `$ react-native link react-native-speech-to-text-ios` 12 | 13 | ## IMPORTANT xCode plist settings 14 | 15 | Also, you need open the React Native xCode project and add two new keys into `Info.plist` 16 | Just right click on `Info.plist` -> `Open As` -> `Source Code` and paste these strings somewhere into root `` tag 17 | 18 | ```xml 19 | NSSpeechRecognitionUsageDescription 20 | Your usage description here 21 | NSMicrophoneUsageDescription 22 | Your usage description here 23 | ``` 24 | 25 | Application will crash if you don't do this. 26 | 27 | ## Usage 28 | 29 | ```js 30 | 31 | import { 32 | ... 33 | NativeAppEventEmitter, 34 | ... 35 | } from 'react-native'; 36 | 37 | var SpeechToText = require('react-native-speech-to-text-ios'); 38 | 39 | ... 40 | 41 | this.subscription = NativeAppEventEmitter.addListener( 42 | 'SpeechToText', 43 | (result) => { 44 | 45 | if (result.error) { 46 | alert(JSON.stringify(result.error)); 47 | } else { 48 | console.log(result.bestTranscription.formattedString); 49 | } 50 | 51 | } 52 | ); 53 | 54 | SpeechToText.startRecognition("en-US"); 55 | 56 | ... 57 | 58 | componentWillUnmount() { 59 | if (this.subscription != null) { 60 | this.subscription.remove(); 61 | this.subscription = null; 62 | } 63 | } 64 | 65 | ``` 66 | 67 | To stop recording call `SpeechToText.finishRecognition()` but after that you can continue to receive event with final recognition results. The events will not arrive after `result.isFinal == true`. 68 | Call `SpeechToText.stopRecognition()` to cancel current recognition task. 69 | The `result` objects reflects Apple `SFSpeechRecognitionResult` class. 70 | 71 | Use this link to reference error codes https://developer.nuance.com/public/Help/DragonMobileSDKReference_iOS/Error-codes.html 72 | -------------------------------------------------------------------------------- /RNSpeechToTextIos.podspec: -------------------------------------------------------------------------------- 1 | require 'json' 2 | 3 | package = JSON.parse(File.read(File.join(__dir__, 'package.json'))) 4 | 5 | Pod::Spec.new do |s| 6 | s.name = "RNSpeechToTextIos" 7 | s.version = package['version'] 8 | s.summary = package['description'] 9 | s.description = package['description'] 10 | s.license = package['license'] 11 | s.author = package['author'] 12 | s.homepage = package['homepage'] 13 | s.source = { :git => 'https://github.com/muhaos/react-native-speech-to-text-ios.git' } 14 | 15 | s.requires_arc = true 16 | s.platform = :ios, '7.0' 17 | 18 | s.preserve_paths = 'README.md', 'package.json', 'index.js' 19 | s.source_files = 'iOS/*.{h,m}' 20 | 21 | s.dependency 'React' 22 | end 23 | -------------------------------------------------------------------------------- /baner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vvmusiienko/react-native-speech-to-text-ios/f446ffe8e145c770dc2758f5c4cc8e449b9a087b/baner.png -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | 2 | import { NativeModules } from 'react-native'; 3 | var RNSpeechToTextIos = NativeModules.RNSpeechToTextIos; 4 | 5 | module.exports = RNSpeechToTextIos; 6 | -------------------------------------------------------------------------------- /ios/RNSpeechToTextIos.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | @interface RNSpeechToTextIos : NSObject 5 | 6 | 7 | @end 8 | 9 | -------------------------------------------------------------------------------- /ios/RNSpeechToTextIos.m: -------------------------------------------------------------------------------- 1 | 2 | #import "RNSpeechToTextIos.h" 3 | #import 4 | #import 5 | #import 6 | #import 7 | #import 8 | 9 | @interface RNSpeechToTextIos () 10 | 11 | @property (nonatomic) SFSpeechRecognizer* speechRecognizer; 12 | @property (nonatomic) SFSpeechAudioBufferRecognitionRequest* recognitionRequest; 13 | @property (nonatomic) AVAudioEngine* audioEngine; 14 | @property (nonatomic) SFSpeechRecognitionTask* recognitionTask; 15 | @property (nonatomic) AVAudioSession* audioSession; 16 | 17 | 18 | @property (nonatomic, weak, readwrite) RCTBridge *bridge; 19 | 20 | @end 21 | 22 | @implementation RNSpeechToTextIos 23 | { 24 | } 25 | 26 | 27 | 28 | - (void) setupAndStartRecognizing:(NSString*)localeStr { 29 | [self teardown]; 30 | 31 | NSLocale* locale = nil; 32 | if ([localeStr length] > 0) { 33 | locale = [NSLocale localeWithLocaleIdentifier:localeStr]; 34 | } 35 | 36 | if (locale) { 37 | self.speechRecognizer = [[SFSpeechRecognizer alloc] initWithLocale:locale]; 38 | } else { 39 | self.speechRecognizer = [[SFSpeechRecognizer alloc] init]; 40 | } 41 | 42 | self.speechRecognizer.delegate = self; 43 | 44 | 45 | NSError* audioSessionError = nil; 46 | self.audioSession = [AVAudioSession sharedInstance]; 47 | [self.audioSession setCategory:AVAudioSessionCategoryRecord error:&audioSessionError]; 48 | if (audioSessionError != nil) { 49 | [self sendResult:RCTMakeError([audioSessionError localizedDescription], nil, nil) :nil :nil :nil]; 50 | return; 51 | } 52 | [self.audioSession setMode:AVAudioSessionModeMeasurement error:&audioSessionError]; 53 | if (audioSessionError != nil) { 54 | [self sendResult:RCTMakeError([audioSessionError localizedDescription], nil, nil) :nil :nil :nil]; 55 | return; 56 | } 57 | [self.audioSession setActive:YES withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation error:&audioSessionError]; 58 | if (audioSessionError != nil) { 59 | [self sendResult:RCTMakeError([audioSessionError localizedDescription], nil, nil) :nil :nil :nil]; 60 | return; 61 | } 62 | 63 | 64 | self.recognitionRequest = [[SFSpeechAudioBufferRecognitionRequest alloc] init]; 65 | 66 | if (self.recognitionRequest == nil){ 67 | [self sendResult:RCTMakeError(@"Unable to created a SFSpeechAudioBufferRecognitionRequest object", nil, nil) :nil :nil :nil]; 68 | return; 69 | } 70 | 71 | if (self.audioEngine == nil) { 72 | self.audioEngine = [[AVAudioEngine alloc] init]; 73 | } 74 | 75 | AVAudioInputNode* inputNode = self.audioEngine.inputNode; 76 | if (inputNode == nil) { 77 | [self sendResult:RCTMakeError(@"Audio engine has no input node", nil, nil) :nil :nil :nil]; 78 | return; 79 | } 80 | 81 | // Configure request so that results are returned before audio recording is finished 82 | self.recognitionRequest.shouldReportPartialResults = YES; 83 | 84 | // A recognition task represents a speech recognition session. 85 | // We keep a reference to the task so that it can be cancelled. 86 | self.recognitionTask = [self.speechRecognizer recognitionTaskWithRequest:self.recognitionRequest resultHandler:^(SFSpeechRecognitionResult * _Nullable result, NSError * _Nullable error) { 87 | 88 | if (error != nil) { 89 | [self sendResult:RCTMakeError([error localizedDescription], nil, nil) :nil :nil :nil]; 90 | [self teardown]; 91 | return; 92 | } 93 | 94 | BOOL isFinal = result.isFinal; 95 | if (result != nil) { 96 | NSMutableArray* transcriptionDics = [NSMutableArray new]; 97 | for (SFTranscription* transcription in result.transcriptions) { 98 | [transcriptionDics addObject:[self dicFromTranscription:transcription]]; 99 | } 100 | 101 | [self sendResult:[NSNull null] :[self dicFromTranscription:result.bestTranscription] :transcriptionDics :@(isFinal)]; 102 | } 103 | 104 | if (isFinal == YES) { 105 | [self teardown]; 106 | } 107 | 108 | NSLog(@"CALLBACK : Final: %i, status:%i", isFinal, self.recognitionTask.state); 109 | 110 | }]; 111 | 112 | AVAudioFormat* recordingFormat = [inputNode outputFormatForBus:0]; 113 | 114 | [inputNode installTapOnBus:0 bufferSize:1024 format:recordingFormat block:^(AVAudioPCMBuffer * _Nonnull buffer, AVAudioTime * _Nonnull when) { 115 | if (self.recognitionRequest != nil) { 116 | [self.recognitionRequest appendAudioPCMBuffer:buffer]; 117 | } 118 | }]; 119 | 120 | [self.audioEngine prepare]; 121 | [self.audioEngine startAndReturnError:&audioSessionError]; 122 | if (audioSessionError != nil) { 123 | [self sendResult:RCTMakeError([audioSessionError localizedDescription], nil, nil) :nil :nil :nil]; 124 | return; 125 | } 126 | } 127 | 128 | - (void) sendResult:(NSDictionary*)error :(NSDictionary*)bestTranscription :(NSArray*)transcriptions :(NSNumber*)isFinal { 129 | // NSString *eventName = notification.userInfo[@"name"]; 130 | NSMutableDictionary* result = [[NSMutableDictionary alloc] init]; 131 | if (error != nil && error != [NSNull null]) { 132 | result[@"error"] = error; 133 | } 134 | if (bestTranscription != nil) { 135 | result[@"bestTranscription"] = bestTranscription; 136 | } 137 | if (transcriptions != nil) { 138 | result[@"transcriptions"] = transcriptions; 139 | } 140 | if (isFinal != nil) { 141 | result[@"isFinal"] = isFinal; 142 | } 143 | 144 | [self.bridge.eventDispatcher sendAppEventWithName:@"SpeechToText" 145 | body:result]; 146 | } 147 | 148 | - (void) teardown { 149 | [self.recognitionTask cancel]; 150 | self.recognitionTask = nil; 151 | [self.audioSession setCategory:AVAudioSessionCategoryAmbient error:nil]; 152 | self.audioSession = nil; 153 | 154 | if (self.audioEngine.isRunning) { 155 | [self.audioEngine stop]; 156 | [self.recognitionRequest endAudio]; 157 | [self.audioEngine.inputNode removeTapOnBus:0]; 158 | } 159 | 160 | self.recognitionRequest = nil; 161 | } 162 | 163 | - (NSDictionary*) dicFromTranscription:(SFTranscription*) transcription { 164 | NSMutableArray* secgmentsDics = [NSMutableArray new]; 165 | for (SFTranscriptionSegment* segment in transcription.segments) { 166 | id dic = @{@"substring":segment.substring, 167 | @"substringRange":@{@"location":@(segment.substringRange.location), 168 | @"length":@(segment.substringRange.length)}, 169 | @"timestamp":@(segment.timestamp), 170 | @"duration":@(segment.duration), 171 | 172 | @"confidence":@(segment.confidence), 173 | @"alternativeSubstrings":segment.alternativeSubstrings, 174 | }; 175 | [secgmentsDics addObject:dic]; 176 | } 177 | 178 | return @{@"formattedString":transcription.formattedString, 179 | @"segments":secgmentsDics}; 180 | } 181 | 182 | 183 | // Called when the availability of the given recognizer changes 184 | - (void)speechRecognizer:(SFSpeechRecognizer *)speechRecognizer availabilityDidChange:(BOOL)available { 185 | if (available == false) { 186 | [self sendResult:RCTMakeError(@"Speech recognition is not available now", nil, nil) :nil :nil :nil]; 187 | } 188 | } 189 | 190 | RCT_EXPORT_METHOD(finishRecognition) 191 | { 192 | // lets finish it 193 | [self.recognitionTask finish]; 194 | } 195 | 196 | 197 | RCT_EXPORT_METHOD(stopRecognition) 198 | { 199 | [self teardown]; 200 | } 201 | 202 | RCT_EXPORT_METHOD(startRecognition:(NSString*)localeStr) 203 | { 204 | if (self.recognitionTask != nil) { 205 | [self sendResult:RCTMakeError(@"Speech recognition already started!", nil, nil) :nil :nil :nil]; 206 | return; 207 | } 208 | 209 | 210 | [SFSpeechRecognizer requestAuthorization:^(SFSpeechRecognizerAuthorizationStatus status) { 211 | switch (status) { 212 | case SFSpeechRecognizerAuthorizationStatusNotDetermined: 213 | [self sendResult:RCTMakeError(@"Speech recognition not yet authorized", nil, nil) :nil :nil :nil]; 214 | break; 215 | case SFSpeechRecognizerAuthorizationStatusDenied: 216 | [self sendResult:RCTMakeError(@"User denied access to speech recognition", nil, nil) :nil :nil :nil]; 217 | break; 218 | case SFSpeechRecognizerAuthorizationStatusRestricted: 219 | [self sendResult:RCTMakeError(@"Speech recognition restricted on this device", nil, nil) :nil :nil :nil]; 220 | break; 221 | case SFSpeechRecognizerAuthorizationStatusAuthorized: 222 | [self setupAndStartRecognizing:localeStr]; 223 | break; 224 | } 225 | }]; 226 | 227 | } 228 | 229 | 230 | 231 | 232 | - (dispatch_queue_t)methodQueue { 233 | return dispatch_get_main_queue(); 234 | } 235 | 236 | RCT_EXPORT_MODULE() 237 | 238 | //- (NSDictionary *)constantsToExport { 239 | // return @{@"greeting": @"Welcome to the DevDactic\n React Native Tutorial!"}; 240 | //} 241 | 242 | 243 | @end 244 | 245 | -------------------------------------------------------------------------------- /ios/RNSpeechToTextIos.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 5601606C1DE7399D00C56270 /* Speech.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5601606B1DE7399D00C56270 /* Speech.framework */; }; 11 | B3E7B58A1CC2AC0600A0062D /* RNSpeechToTextIos.m in Sources */ = {isa = PBXBuildFile; fileRef = B3E7B5891CC2AC0600A0062D /* RNSpeechToTextIos.m */; }; 12 | /* End PBXBuildFile section */ 13 | 14 | /* Begin PBXCopyFilesBuildPhase section */ 15 | 58B511D91A9E6C8500147676 /* 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 | 134814201AA4EA6300B7C361 /* libRNSpeechToTextIos.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRNSpeechToTextIos.a; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 5601606B1DE7399D00C56270 /* Speech.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Speech.framework; path = System/Library/Frameworks/Speech.framework; sourceTree = SDKROOT; }; 29 | B3E7B5881CC2AC0600A0062D /* RNSpeechToTextIos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNSpeechToTextIos.h; sourceTree = ""; }; 30 | B3E7B5891CC2AC0600A0062D /* RNSpeechToTextIos.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNSpeechToTextIos.m; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | 58B511D81A9E6C8500147676 /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | 5601606C1DE7399D00C56270 /* Speech.framework in Frameworks */, 39 | ); 40 | runOnlyForDeploymentPostprocessing = 0; 41 | }; 42 | /* End PBXFrameworksBuildPhase section */ 43 | 44 | /* Begin PBXGroup section */ 45 | 134814211AA4EA7D00B7C361 /* Products */ = { 46 | isa = PBXGroup; 47 | children = ( 48 | 134814201AA4EA6300B7C361 /* libRNSpeechToTextIos.a */, 49 | ); 50 | name = Products; 51 | sourceTree = ""; 52 | }; 53 | 5601606A1DE7399D00C56270 /* Frameworks */ = { 54 | isa = PBXGroup; 55 | children = ( 56 | 5601606B1DE7399D00C56270 /* Speech.framework */, 57 | ); 58 | name = Frameworks; 59 | sourceTree = ""; 60 | }; 61 | 58B511D21A9E6C8500147676 = { 62 | isa = PBXGroup; 63 | children = ( 64 | B3E7B5881CC2AC0600A0062D /* RNSpeechToTextIos.h */, 65 | B3E7B5891CC2AC0600A0062D /* RNSpeechToTextIos.m */, 66 | 134814211AA4EA7D00B7C361 /* Products */, 67 | 5601606A1DE7399D00C56270 /* Frameworks */, 68 | ); 69 | sourceTree = ""; 70 | }; 71 | /* End PBXGroup section */ 72 | 73 | /* Begin PBXNativeTarget section */ 74 | 58B511DA1A9E6C8500147676 /* RNSpeechToTextIos */ = { 75 | isa = PBXNativeTarget; 76 | buildConfigurationList = 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNSpeechToTextIos" */; 77 | buildPhases = ( 78 | 58B511D71A9E6C8500147676 /* Sources */, 79 | 58B511D81A9E6C8500147676 /* Frameworks */, 80 | 58B511D91A9E6C8500147676 /* CopyFiles */, 81 | ); 82 | buildRules = ( 83 | ); 84 | dependencies = ( 85 | ); 86 | name = RNSpeechToTextIos; 87 | productName = RCTDataManager; 88 | productReference = 134814201AA4EA6300B7C361 /* libRNSpeechToTextIos.a */; 89 | productType = "com.apple.product-type.library.static"; 90 | }; 91 | /* End PBXNativeTarget section */ 92 | 93 | /* Begin PBXProject section */ 94 | 58B511D31A9E6C8500147676 /* Project object */ = { 95 | isa = PBXProject; 96 | attributes = { 97 | LastUpgradeCheck = 0610; 98 | ORGANIZATIONNAME = Facebook; 99 | TargetAttributes = { 100 | 58B511DA1A9E6C8500147676 = { 101 | CreatedOnToolsVersion = 6.1.1; 102 | }; 103 | }; 104 | }; 105 | buildConfigurationList = 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNSpeechToTextIos" */; 106 | compatibilityVersion = "Xcode 3.2"; 107 | developmentRegion = English; 108 | hasScannedForEncodings = 0; 109 | knownRegions = ( 110 | en, 111 | ); 112 | mainGroup = 58B511D21A9E6C8500147676; 113 | productRefGroup = 58B511D21A9E6C8500147676; 114 | projectDirPath = ""; 115 | projectRoot = ""; 116 | targets = ( 117 | 58B511DA1A9E6C8500147676 /* RNSpeechToTextIos */, 118 | ); 119 | }; 120 | /* End PBXProject section */ 121 | 122 | /* Begin PBXSourcesBuildPhase section */ 123 | 58B511D71A9E6C8500147676 /* Sources */ = { 124 | isa = PBXSourcesBuildPhase; 125 | buildActionMask = 2147483647; 126 | files = ( 127 | B3E7B58A1CC2AC0600A0062D /* RNSpeechToTextIos.m in Sources */, 128 | ); 129 | runOnlyForDeploymentPostprocessing = 0; 130 | }; 131 | /* End PBXSourcesBuildPhase section */ 132 | 133 | /* Begin XCBuildConfiguration section */ 134 | 58B511ED1A9E6C8500147676 /* Debug */ = { 135 | isa = XCBuildConfiguration; 136 | buildSettings = { 137 | ALWAYS_SEARCH_USER_PATHS = NO; 138 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 139 | CLANG_CXX_LIBRARY = "libc++"; 140 | CLANG_ENABLE_MODULES = YES; 141 | CLANG_ENABLE_OBJC_ARC = YES; 142 | CLANG_WARN_BOOL_CONVERSION = YES; 143 | CLANG_WARN_CONSTANT_CONVERSION = YES; 144 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 145 | CLANG_WARN_EMPTY_BODY = YES; 146 | CLANG_WARN_ENUM_CONVERSION = YES; 147 | CLANG_WARN_INT_CONVERSION = YES; 148 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 149 | CLANG_WARN_UNREACHABLE_CODE = YES; 150 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 151 | COPY_PHASE_STRIP = NO; 152 | ENABLE_STRICT_OBJC_MSGSEND = YES; 153 | GCC_C_LANGUAGE_STANDARD = gnu99; 154 | GCC_DYNAMIC_NO_PIC = NO; 155 | GCC_OPTIMIZATION_LEVEL = 0; 156 | GCC_PREPROCESSOR_DEFINITIONS = ( 157 | "DEBUG=1", 158 | "$(inherited)", 159 | ); 160 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 161 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 162 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 163 | GCC_WARN_UNDECLARED_SELECTOR = YES; 164 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 165 | GCC_WARN_UNUSED_FUNCTION = YES; 166 | GCC_WARN_UNUSED_VARIABLE = YES; 167 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 168 | MTL_ENABLE_DEBUG_INFO = YES; 169 | ONLY_ACTIVE_ARCH = YES; 170 | SDKROOT = iphoneos; 171 | }; 172 | name = Debug; 173 | }; 174 | 58B511EE1A9E6C8500147676 /* Release */ = { 175 | isa = XCBuildConfiguration; 176 | buildSettings = { 177 | ALWAYS_SEARCH_USER_PATHS = NO; 178 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 179 | CLANG_CXX_LIBRARY = "libc++"; 180 | CLANG_ENABLE_MODULES = YES; 181 | CLANG_ENABLE_OBJC_ARC = YES; 182 | CLANG_WARN_BOOL_CONVERSION = YES; 183 | CLANG_WARN_CONSTANT_CONVERSION = YES; 184 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 185 | CLANG_WARN_EMPTY_BODY = YES; 186 | CLANG_WARN_ENUM_CONVERSION = YES; 187 | CLANG_WARN_INT_CONVERSION = YES; 188 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 189 | CLANG_WARN_UNREACHABLE_CODE = YES; 190 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 191 | COPY_PHASE_STRIP = YES; 192 | ENABLE_NS_ASSERTIONS = NO; 193 | ENABLE_STRICT_OBJC_MSGSEND = YES; 194 | GCC_C_LANGUAGE_STANDARD = gnu99; 195 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 196 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 197 | GCC_WARN_UNDECLARED_SELECTOR = YES; 198 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 199 | GCC_WARN_UNUSED_FUNCTION = YES; 200 | GCC_WARN_UNUSED_VARIABLE = YES; 201 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 202 | MTL_ENABLE_DEBUG_INFO = NO; 203 | SDKROOT = iphoneos; 204 | VALIDATE_PRODUCT = YES; 205 | }; 206 | name = Release; 207 | }; 208 | 58B511F01A9E6C8500147676 /* Debug */ = { 209 | isa = XCBuildConfiguration; 210 | buildSettings = { 211 | HEADER_SEARCH_PATHS = ( 212 | "$(inherited)", 213 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 214 | "$(SRCROOT)/../../../React/**", 215 | "$(SRCROOT)/../../react-native/React/**", 216 | ); 217 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 218 | OTHER_LDFLAGS = "-ObjC"; 219 | PRODUCT_NAME = RNSpeechToTextIos; 220 | SKIP_INSTALL = YES; 221 | }; 222 | name = Debug; 223 | }; 224 | 58B511F11A9E6C8500147676 /* Release */ = { 225 | isa = XCBuildConfiguration; 226 | buildSettings = { 227 | HEADER_SEARCH_PATHS = ( 228 | "$(inherited)", 229 | /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include, 230 | "$(SRCROOT)/../../../React/**", 231 | "$(SRCROOT)/../../react-native/React/**", 232 | ); 233 | LIBRARY_SEARCH_PATHS = "$(inherited)"; 234 | OTHER_LDFLAGS = "-ObjC"; 235 | PRODUCT_NAME = RNSpeechToTextIos; 236 | SKIP_INSTALL = YES; 237 | }; 238 | name = Release; 239 | }; 240 | /* End XCBuildConfiguration section */ 241 | 242 | /* Begin XCConfigurationList section */ 243 | 58B511D61A9E6C8500147676 /* Build configuration list for PBXProject "RNSpeechToTextIos" */ = { 244 | isa = XCConfigurationList; 245 | buildConfigurations = ( 246 | 58B511ED1A9E6C8500147676 /* Debug */, 247 | 58B511EE1A9E6C8500147676 /* Release */, 248 | ); 249 | defaultConfigurationIsVisible = 0; 250 | defaultConfigurationName = Release; 251 | }; 252 | 58B511EF1A9E6C8500147676 /* Build configuration list for PBXNativeTarget "RNSpeechToTextIos" */ = { 253 | isa = XCConfigurationList; 254 | buildConfigurations = ( 255 | 58B511F01A9E6C8500147676 /* Debug */, 256 | 58B511F11A9E6C8500147676 /* Release */, 257 | ); 258 | defaultConfigurationIsVisible = 0; 259 | defaultConfigurationName = Release; 260 | }; 261 | /* End XCConfigurationList section */ 262 | }; 263 | rootObject = 58B511D31A9E6C8500147676 /* Project object */; 264 | } 265 | -------------------------------------------------------------------------------- /ios/RNSpeechToTextIos.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/RNSpeechToTextIos.xcodeproj/project.xcworkspace/xcuserdata/muhaos.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vvmusiienko/react-native-speech-to-text-ios/f446ffe8e145c770dc2758f5c4cc8e449b9a087b/ios/RNSpeechToTextIos.xcodeproj/project.xcworkspace/xcuserdata/muhaos.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ios/RNSpeechToTextIos.xcodeproj/xcuserdata/muhaos.xcuserdatad/xcschemes/RNSpeechToTextIos.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 | -------------------------------------------------------------------------------- /ios/RNSpeechToTextIos.xcodeproj/xcuserdata/muhaos.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | RNSpeechToTextIos.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 58B511DA1A9E6C8500147676 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Volodymyr Musiienko ", 3 | "dependencies": {}, 4 | "description": "React Native speech recognition component for iOS 10+", 5 | "devDependencies": {}, 6 | "directories": {}, 7 | "dist": { 8 | "shasum": "9d67483f3b7857a0873d952e289a4a5fcbac6ae5", 9 | "tarball": "https://registry.npmjs.org/react-native-speech-to-text-ios/-/react-native-speech-to-text-ios-1.0.0.tgz" 10 | }, 11 | "keywords": [ 12 | "react-native", 13 | "speech", 14 | "recognition" 15 | ], 16 | "license": "", 17 | "main": "index.js", 18 | "repository": { 19 | "type": "git", 20 | "url": "https://github.com/muhaos/react-native-speech-to-text-ios" 21 | }, 22 | "maintainers": [ 23 | { 24 | "name": "muhaos", 25 | "email": "volodymir.musienko@gmail.com" 26 | } 27 | ], 28 | "name": "react-native-speech-to-text-ios", 29 | "optionalDependencies": {}, 30 | "peerDependencies": { 31 | "react-native": "^0.40.0" 32 | }, 33 | "readme": "ERROR: No README data found!", 34 | "scripts": { 35 | "test": "echo \"Error: no test specified\" && exit 1" 36 | }, 37 | "version": "1.0.3", 38 | "homepage": "https://github.com/muhaos/react-native-speech-to-text-ios#readme" 39 | } 40 | --------------------------------------------------------------------------------