React Native 프로젝트에 Hermes 엔진 적용
DoveRunner Mobile App Security SDK를 React Native 앱에 적용하려면 React Native 프로젝트가 Hermes JavaScript 엔진을 사용하도록 구성하고 DoveRunner Mobile App Security 보안 로직이 포함된 Hermes 라이브러리로 교체해야 합니다. (앱 개발의 마지막 단계에서 DoveRunner Mobile App Security를 적용하는 것이 권장됩니다)
Hermes 엔진 활성화
Section titled “Hermes 엔진 활성화”React Native 0.64 이상에서는 Hermes가 기본적으로 활성화되어 있지만, 명시적으로 확인하고 설정해야 합니다.
iOS에서 Hermes 활성화
Section titled “iOS에서 Hermes 활성화”ios/Podfile
을 열고 다음 라인이 있는지 확인하세요:
:hermes_enabled => true
- 전체 설정 예시:
use_react_native!( :path => config[:reactNativePath], :hermes_enabled => true)
- 변경 후 pod를 업데이트합니다:
cd iospod install
React Native 버전별 설정
Section titled “React Native 버전별 설정”React Native 0.64 이상
Section titled “React Native 0.64 이상”React Native 0.64부터는 Hermes가 기본적으로 지원됩니다. metro.config.js
에서 Hermes 설정을 확인하세요:
module.exports = { transformer: { hermesParser: true, },};
React Native 0.60-0.63
Section titled “React Native 0.60-0.63”이 버전에서는 수동으로 Hermes를 활성화해야 할 수 있습니다:
ios/Podfile
에서:
use_react_native!(:path => config[:reactNativePath], :hermes_enabled => true)
android/app/build.gradle
에서:
project.ext.react = [ enableHermes: true]
Hermes 활성화 확인
Section titled “Hermes 활성화 확인”앱을 실행한 후 다음 코드로 Hermes가 활성화되었는지 확인할 수 있습니다:
const isHermes = () => !!global.HermesInternal;
console.log('Hermes enabled:', isHermes());
또는 React Native 개발자 도구에서 JavaScript 엔진 정보를 확인할 수 있습니다.
- Hermes 엔진을 활성화하면 앱의 시작 성능이 향상되지만 일부 JavaScript 기능이 제한될 수 있습니다
- DoveRunner Mobile App Security는 Hermes 엔진에서만 작동하므로 이 단계는 필수입니다
- 기존 프로젝트에서 Hermes를 활성화할 때는 철저한 테스트가 필요합니다
Hermes 엔진이 성공적으로 활성화되면 다음 단계는 SDK 파일 적용입니다.