Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
16 lines (11 sloc) 363 Bytes
#include "Encoding.h"
#include "RCTRootView.h"
@implementation Encoding
RCT_EXPORT_MODULE();
RCT_EXPORT_METHOD(base64Encode:(NSString*)str callback:(RCTResponseSenderBlock)callback)
{
NSData *nsdata = [str dataUsingEncoding:NSUTF8StringEncoding];
NSString *base64Encoded = [nsdata base64EncodedStringWithOptions:0];
callback(@[base64Encoded]);
}
@end
You can’t perform that action at this time.