react-native

React Native

react-native webview 영역이 사라질 경우 앱 꺼지는 문제

react-native 에서 WebView 사용시 일부 기기의 Android에서 충돌로 인해 앱이 강제 종료가 되는 문제가 발생 style 속성에 opacity:0.99, minHeight:1를 추가를 하는것으로 해결이 가능하지만 정상적인 해결 방법은 아닌것 같다

React Native

안드로이드 기기에서 진동/무음모드를 설정시 알림음 해결 방법

react-native-push-notification 라이브러리 사용할 경우 안드로이드 기기에서 진동/무음모드를 설정시 알림음 해결 방법 node_modules/react-native-push-notification/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java 위 경로의 RNPushNotificationHelper.java 파일 수정 try { if (soundUri != null) { AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); mAudioManager..

React Native

react-native webview alert message url 안보이도록 ...

react-native 웹뷰로 구성된 화면에서 자바스크립트로 alert 메시지를 띄울때 url 표시가 되는데 보기가 싫어서 url 삭제하고자 하는 경우 아래처럼 코드를 추가해주면 됩니다 android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java // 아래 코드 추가 import android.app.AlertDialog; import android.content.DialogInterface; import android.webkit.JsResult; protected void setupWebChromeClient(ReactContext reactContext, WebView webView) { if (mAllowsFullscr..

React Native

REACT-NATIVE 안드로이드 웹뷰에서 파일 업로드 카메라 권한 요청

REACT-NATIVE 안드로이드 웹뷰에서 파일 업로드 카메라 권한 요청 android/src/main/java/com/reactnativecommunity/webview/ RNCWebViewModule.java RNCWebViewModule.java 파일 수정 @ReactModule(name = RNCWebViewModule.MODULE_NAME) public class RNCWebViewModule extends ReactContextBaseJavaModule implements ActivityEventListener { private static final int PICKER = 1; private static final int PICKER_LEGACY = 3; private static final..

React Native

REACT-NATIVE 인터넷 연결 확인

어떤 경우에는 앱에서 작업을 시작하기 전에 장치가 인터넷에 연결되어 있는지 확인할 필요가 있을때 Netinfo 라이브러리를 사용하여 확인할 수 있으며 애플리케이션의 React Native 버전에 따라 다릅니다. RN : 버전> = 0.60 import NetInfo from "@react-native-community/netinfo"; NetInfo.fetch().then(state => { console.log("Connection type", state.type); console.log("Is connected?", state.isConnected); }); isConnected: boolean, Type: none, wifi, bluetooth, cellular. RN : 버전 { console.l..

React Native

react-native-webview (웹뷰)에서 카드 결제 또는 외부앱 실행하기

Android 에서 react-native-webview (웹뷰) 카드 결제 또는 외부앱 실행하기 1. react-native-send-intent 라이브러리를 이용해 인텐트 호출 - install npm install react-native-send-intent --save react-native link react-native-send-intent 2. android/setting.gradle 파일에 아래의 코드를 추가 include ':RNSendIntentModule', ':app' project(':RNSendIntentModule').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-send-intent/an..

React Native

[react-native] Error : Unable to load script. Make sure youre dither running a Metro server... index.android.bundle is packaged correctly for release

react-native 최초 설치 후 안드로이드 스튜디오로 실행할 경우 위와 같은 오류 발생할때 1. [패키지명]/android/app/src/main/assets 폴더가 있는지 확인하고 없으면 생성 2. [패키지명]/android 폴더에서 ./gradlew clean 실행 3. [패키지명] 폴더에서 아래 명령어 실행 react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res 4. react-native run-android

projin
'react-native' 태그의 글 목록