wn-na / react-native-capture-protection

It’s a library for React Native to control simple capture events(i.e. Screenshot or Screen record)
https://www.npmjs.com/package/react-native-capture-protection
MIT License
102 stars 10 forks source link

Cannot build iOS due to `Use of undeclared identifier 'facebook'` #57

Open zaiehilmi opened 7 hours ago

zaiehilmi commented 7 hours ago

Hi there,

React native: 0.76.2 Xcode: 16.1 react-native-capture-protection: 1.9.13

I got this error after I try to build for iOS. after looking into the xcode, from this code got error as the title.

here is the path where you can find the issue node_modules/react-native-capture-protection/ios/CaptureProtection.mm

#ifdef RCT_NEW_ARCH_ENABLED
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
    (const facebook::react::ObjCTurboModule::InitParams &)params
{
    return std::make_shared<facebook::react::NativeCaptureProtectionSpecJSI>(params);
}
#endif

I commented it and after that I can successfully build.