Created
January 5, 2019 06:53
-
-
Save ryardley/65930b26292fe4e8d837c772d36ac996 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ios/ReactBridge/RCTHelloWorld.m | |
#import "RCTHelloWorld.h" | |
#import "HWHelloWorld.h" | |
@implementation RCTHelloWorld{ | |
HWHelloWorld *_cppApi; | |
} | |
- (RCTHelloWorld *)init | |
{ | |
self = [super init]; | |
_cppApi = [HWHelloWorld create]; | |
return self; | |
} | |
+ (BOOL)requiresMainQueueSetup | |
{ | |
return NO; | |
} | |
RCT_EXPORT_MODULE(); | |
RCT_REMAP_METHOD(sayHello, | |
resolver:(RCTPromiseResolveBlock)resolve | |
rejecter:(RCTPromiseRejectBlock)reject) | |
{ | |
NSString *response = [_cppApi getHelloWorld]; | |
resolve(response); | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment