목록자바스크립트 (92)
바르고 뜨겁게
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..
ERRORJavascript , ReactNative 등 에서 http 요청시 에러Access to XMLHttpRequest at '[ 요청 주소 ]' from origin '[ 응답 주소 ]' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.Network error원인 및 해결https://brunch.co.kr/@adrenalinee31/1
리액트는 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 안드로이드 앱 아이콘 , IOS 앱 아이콘 자동 생성 해주는 사이트https://appicon.co/
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..
React-native Android release Build APK 생성 리액트 앱을 안드로이드 마켓에 출시하기위해 릴리즈 빌드 apk 만들기 서버 네트워크 통신 허용따라서 아래의 방법을 따라서 서버 ip를 허용해줘야한다. [ 아이피 추가 ] /android/app/src/main/AndroidManifest.xml Android/app/src/release/res/xml/react_native_config.xml 안드로이드 릴리즈 빌드에선 암호화 되지 않은 않은 서버의 http 통신은 차단된다. 매니페스트 수정/android/app/src/main/AndroidManifest.xml