Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#import "MCFileWriterUtil.h"
@implementation MCFileWriterUtil
// Expose this module to the React Native bridge
RCT_EXPORT_MODULE()
// Persist data
RCT_EXPORT_METHOD(writeFile:(NSString *)fileName
withContents:(NSString *)contents
errorCallback:(RCTResponseSenderBlock)failureCallback
callback:(RCTResponseSenderBlock)successCallback) {
NSLog(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
successCallback(@[@"Write method called"]);
}
// Load data from disk and return the String.
RCT_EXPORT_METHOD(readFile:(NSString *)fileName
errorCallback:(RCTResponseSenderBlock)failureCallback
callback:(RCTResponseSenderBlock)successCallback) {
NSLog(@"%@ %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd));
successCallback(@[@"Read method called"]);
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.