Skip to content

Commit

Permalink
feat(ios): lz4::getLz4VersionString objective-c bind
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoguzmana committed Sep 26, 2024
1 parent 88666b0 commit f83e540
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- react-native-lz4 (0.1.0):
- react-native-lz4 (0.0.0):
- DoubleConversion
- glog
- RCT-Folly (= 2024.01.01.00)
Expand Down Expand Up @@ -1739,7 +1739,7 @@ SPEC CHECKSUMS:
React-logger: 4072f39df335ca443932e0ccece41fbeb5ca8404
React-Mapbuffer: 714f2fae68edcabfc332b754e9fbaa8cfc68fdd4
React-microtasksnativemodule: 987cf7e0e0e7129250a48b807e70d3b906c726cf
react-native-lz4: 7abf179ca5a49ba37f3e4ef4c8ca6171cb5fe380
react-native-lz4: 83c551bc4a8a33494e2e682396476722719124d1
React-nativeconfig: 4a9543185905fe41014c06776bf126083795aed9
React-NativeModulesApple: 651670a799672bd54469f2981d91493dda361ddf
React-perflogger: 3bbb82f18e9ac29a1a6931568e99d6305ef4403b
Expand Down
9 changes: 9 additions & 0 deletions ios/Lz4.mm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ @implementation Lz4
resolve(result);
}

RCT_EXPORT_METHOD(getLz4VersionString:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject)
{
std::string versionString = lz4::getLz4VersionString();
NSString *result = [NSString stringWithUTF8String:versionString.c_str()];

resolve(result);
}

// Don't compile this code when we build for the old architecture.
#ifdef RCT_NEW_ARCH_ENABLED
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
Expand Down

0 comments on commit f83e540

Please sign in to comment.