1. react native 에서 실제로 접속할 웹뷰주소 확인하여 크롬 인터넷 창에 직접 접속



예)


http://test.testsite.com/?at=e]ePz6fxG0&rt=2535235.a0f52dbe00





2. react native   web view 에서  userAgent="ss-ios-sdk" 설정되어 있을 경우




아래와 같이 변경


ss-ios-sdk  추가








react native 에 facebook login 기능을 추가하기 위해서 FBSDK 만 적용했다하면 아래와 같은 에러 발생


팝업은 무시하시고 빨간 에러창만 참고하시면 됩니다.





fbsdksharekit/fbsdksharekit.h' file not found


or 


fbsdkcorekit/fbsdkcorekit.h' file not found




그래서 지금까지 한 것중에 제일 좋은 해결책은


기존에 있는 Frameworks 디렉토리를 Frameworks2로 변경하거나 삭제하고 


새로운 Frameworks 디렉토리를 만드는 것이다





Build Settings에서 Framework Search Paths 도 ~ 표시가 아니고 


아래와 같이 직접 입력하시는 것이 좋습니다.


그리고 실제로 아래 경로에 FBSDK 는 다운 받아서 복사 하셔야 합니다.





그냥 참고사항....


Xcode에 복사할 때는 저는 아래와 같은 옵션으로 복사하였습니다.






react-native-video 



react-native init Video


cd Video


cat package.json

{

  "name": "Video",

  "version": "0.0.1",

  "private": true,

  "scripts": {

    "start": "node node_modules/react-native/local-cli/cli.js start",

    "test": "jest"

  },

  "dependencies": {

    "react": "16.6.3",

    "react-native": "0.57.8"

  },

  "devDependencies": {

    "babel-jest": "23.6.0",

    "jest": "23.6.0",

    "metro-react-native-babel-preset": "0.51.1",

    "react-test-renderer": "16.6.3"

  },

  "jest": {

    "preset": "react-native"

  }



npm install react-native-video --save




cat package.json

{

  "name": "Video",

  "version": "0.0.1",

  "private": true,

  "scripts": {

    "start": "node node_modules/react-native/local-cli/cli.js start",

    "test": "jest"

  },

  "dependencies": {

    "react": "16.6.3",

    "react-native": "0.57.8",

    "react-native-video": "^4.2.0"

  },

  "devDependencies": {

    "babel-jest": "23.6.0",

    "jest": "23.6.0",

    "metro-react-native-babel-preset": "0.51.1",

    "react-test-renderer": "16.6.3"

  },

  "jest": {

    "preset": "react-native"

  }

}



react-native link


rnpm-install info Linking react-native-video ios dependency

rnpm-install info Platform 'ios' module react-native-video has been successfully linked

rnpm-install info Linking react-native-video android dependency

rnpm-install info Platform 'android' module react-native-video has been successfully linked



react-native run-ios




app.js 내용



import React, { Component } from "react"
import { StyleSheet, Text, View } from "react-native"

class App extends Component {
render() {
return (
<View style={styles.container}>
<Text>Text</Text>
</View>
)
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#F5FCFF"
}
})

export default App

import Video 하고 비디오 출력 , warbler.mp4 파일 로컬 경로에 추가



/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow
*/

import React, { Component } from "react"
import { StyleSheet, Text, View } from "react-native"
import Video from "react-native-video"

class App extends Component {
render() {
return (
<View style={styles.container}>
<Video
source={require("./warbler.mp4")} // URL이나 local 파일을 지정할 수 있다.
rate={1.0} // 0은 일시정지, 1은 정상 속도
volume={1.0} // 0은 음소거, 1은 정상 음량
muted={false} // 오디오를 완전히 음소거
paused={false} // 비디오를 완전히 일시 정지
// resizeMode="cover" // 화면 비율을 유지한 채로 화면 가득 채움
repeat={true} // 무한 반복
style={styles.fullScreen}
/>
</View>
)
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: "center",
backgroundColor: "#F5FCFF"
},
fullScreen: {
position: "absolute",
top: 0,
left: 0,
bottom: 0,
right: 0
}
})

export default App


아래 에러 발생할 경우 

TypeError: Cannot read property 'Constants' of undefined


해당 xcode => Build Phases => Link Binary With Libraries 

libRCTVideo.a 삭제 후 video 추가 해서 해결 

ㄷㅏ시  테스트 하려니 잘 수행되네..



아래는 내가 에러 내용 찾을 때 검색했던 사이트와 해결내용


https://github.com/react-native-community/react-native-video/issues/438



I found the solution that fixed me the problem.

Go to.. xCode -> Build Phases -> Link Binary With Libraries.

In the list find the file "libRCTVideo.a", if you will see it like icon of clean white paper than just delete it from the list and add it again by click on the plus (+) icon and just type "video" and add it.

Now in the commnd line run the commnad: "react-native run-ios", and "WALLA" no error.

+ Recent posts