Skip to content

Instantly share code, notes, and snippets.

@ryardley
Created January 5, 2019 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryardley/65930b26292fe4e8d837c772d36ac996 to your computer and use it in GitHub Desktop.
Save ryardley/65930b26292fe4e8d837c772d36ac996 to your computer and use it in GitHub Desktop.
// 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