목록react-native (11)
바르고 뜨겁게
Axios multipart image network errorhttp 통신을 사용하여 멀티파트 업로드를 구현중 ... 이미지를 폼데이터에 추가하면Network Error가 발행되는 경우가 있다. 1. name, type, uri 확인간혹 type을 빼먹으면 network error가 난다고 하니 주의하자.formData.append("imgPath01", { name: "imgPath01.jpg", type: imgPath01.mime, uri: imgPath01.path }); 2. 안드로이드 FLIPPER_VERSION 버전 업그레이드android > gradle.propertiesFLIPPER_VERSION=0.46.02-2. 클린 , 리빌드android ->app->source->debug2-1..
React Native - IOS UIWebView Deprecated 해결 방법 20.05.01 기준으로 프로젝트에 UIWebView 포함시 IOS Appstore Connect 에 앱을 업로드하게 되면 아래 메시지가 출력되며 앱이 업로드 되지 않는다. ITMS-90809: Deprecated API Usage - New apps that use UIWebView are no longer accepted. Instead, use WKWebView for improved security and reliability. Learn more (https://developer.apple.com/documentation/uikit/uiwebview). 이 때 살펴봐야될 부분들을 정리해보습니다. webview를 의..
프로젝트 생성모듈용 템플릿 도구 create-react-native-module 설치npm install -g react-native-cli yarn npm install -g create-react-native-module 프로젝트 생성create-react-native-module --prefix RN --package-identifier [ 패키지 식별자 ] --generate-example [ 프로젝트 이름 ]--prefix : 라이브러리 접두사--package-identifier : 안드로이드 패키지 식별자 (ex : com.righthot)--view : 매우 간단한 기본 뷰 구성 요소로 모듈 생성 (미 입력시 기본 모듈형태 프로젝트 생성)--generate-example : 예제 프로젝트를 ..
React Native - Facebook Audience 광고 적용하기 (react-native-fbads)https://github.com/callstack/react-native-fbads#installation1. Facebook SDK 설치 https://github.com/facebook/react-native-fbsdk페이스북 로그인을 적용했다면, 건너뛰어도 됩니다.2. Facebook Audience 설치패키지 설치 및 링크 yarn add react-native-fbads react-native link react-native-fbads네이티브 프로젝트에 추가IOSiOS/Podfile pod 'FBAudienceNetwork', '~> 5.1.0' pod installANDROIDMain..
React native [Object object] 출력 및 값 확인서버 통신 처리를 하다보면 프론트에서는 서버 값을 로그로 확인한다.보통 JSON.stringify(object) 혹은 String(object) 형태로 값 확인이 가능하지만...Type 이 정확하지 않을 경우 Type Error 를 발생 시킨다.그럴 땐 아래 방법으로 key를 구한 뒤 JSON.stringify(object.key) 혹은 String(object.key) 로 확인하면 된다. for (var key in object) { console.log("key: " + key + " / " + object[key]) }
ReactNative - Lottie 사용시 ErrorVSCode 에서 IOS 빌드시 다음과 같은 에러가 난다The following build commands failed: Ld build/[프로젝트명]/Build/Products/Debug-iphoneos/[프로젝트명].app/PlugIns/[프로젝트명]Tests.xctest/[프로젝트명]Tests normal arm64 --- 해결 방법 xCode의 [프로젝트 명] 폴더에 File.swift 를 생성한다.react-naitve start 를 하지 않은 상태에서 xCode 에서 run --- 문제점react-naitve start 를 하지 않은 상태에서 xCode 에서 run 을 했을시 정상 동작한다. - 만약 react-native start 후 x..
리액트는 array에 값을 추가할 때 push 를 사용하면 안된다.array에 push를 하는경우 state의 변경을 리액트가 알지 못하기 때문 const array = []; array.push(1)array === array : true 이기 때문에 리액트가 감지 하지 못한다.따라서 아래처럼 사용해줘야한다 const array2 = [...array, 2]array === array2 : false
react native [ERROR] Signing for "[ project name ]" requires a development team. Select a development team in the Signing & Capabilities editor.Code signing is required for product type 'Unit Test Bundle' in SDK 'iOS 13.1' 해결 방법1. Build Settings - Signing - Code Signing IDentity 하위 항목을 모두 IOS Developer 로 바꿔준다.2. Xcode → Product → Clean3. Xcode 재시작
https://github.com/facebook/react-native/issues/26619#issuecomment-536191518https://github.com/facebook/react-native/issues/26299 IOS 13 버전에 다크모드가 추가되면서 디폴트 TEXT 컬러가 흰색으로 바껴서 밝은 배경에선 보이지 않는다거나,StatusBar 아이콘이 흰색으로 바껴서 보이지 않는 등의 문제점들이 발생따라서, 다크모드를 사용 하지 않기 위해선 react native 코드를 아래처럼 수정 Light-mode 강제적용appDelegate.m if (@available(iOS 13.0, *)) { rootView.overrideUserInterfaceStyle = UIUserInterfaceS..
react-native FlatList Chat View example fbData : Chat dataimport React, { Component } from 'react'; import { FlatList, StyleSheet, View, SafeAreaView, KeyboardAvoidingView, Alert, TouchableOpacity, TextInput, Image, Text,Dimensions } from 'react-native'; class Message extends Component { constructor() { super(); this.state = { loading: true, fbData: [{ userID: 'efgh1234', text: `Hi, I'm Sophia..