React Native Blueprints by Emilio Rodriguez Martinez

React Native Blueprints by Emilio Rodriguez Martinez

Author:Emilio Rodriguez Martinez [Emilio Rodriguez Martinez]
Language: eng
Format: epub
Tags: JavaScript
Publisher: Packt Publishing
Published: 2017-11-07T22:00:00+00:00


#import "FrequencyDetector.h" #import "SCListener.h" NSString *freq = @""; @implementation FrequencyDetector RCT_EXPORT_MODULE(); RCT_EXPORT_METHOD(getFrequency:(RCTResponseSenderBlock)callback) { double power = [[SCListener sharedListener] averagePower]; if(power < 0.03) { //ignore low volumes freq = @"0"; } else { freq = [NSString stringWithFormat:@"%0.3f",

[[SCListener sharedListener] frequency]]; } callback(@[[NSNull null], freq]); } RCT_EXPORT_METHOD(initialise) { [[SCListener sharedListener] listen]; } @end

Even for non-Objective-C developers, this code should be easy to understand:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.