컴퓨터 커뮤니티


간단 웹뷰어 구현 소스

최고관리자 0 82 03.28 15:00

기본 유틸 및 개발 환경 구축

nodejs 설치

https://nodejs.org/en/download


vscode 설치

https://code.visualstudio.com/


git 설치

https://git-scm.com/download/win



도스명령어


npm install -g expo-cli

npx create-expo-app my-app  >>     npx create-expo-app SEOUL

npm install -g eas-cli

npx expo install react-native-webview

npx eas login (https://expo.dev/ 아이디생성 가능)


cd SEOUL

npx eas build:configure


App.js

import * as React from 'react';

import { WebView } from 'react-native-webview';

import { StyleSheet } from 'react-native';

import Constants from 'expo-constants';


export default function App() {

  return (

    <WebView

      style={styles.container}

      source={{ uri: 'https://seoul.go.kr' }}

    />

  );

}


const styles = StyleSheet.create({

  container: {

    flex: 1,

    marginTop: Constants.statusBarHeight,

  },

});



eas.json


{

  "cli": {

    "version": ">= 7.6.0"

  },

  "build": {

    "preview": {

      "android": {

        "buildType": "apk"

      }

    },

    "preview2": {

      "android": {

        "gradleCommand": ":app:assembleRelease"

      }

    },

    "preview3": {

      "developmentClient": true

    },

    "preview4": {

      "distribution": "internal"

    },

    "production": {}

  }

}



npx eas build -p android --profile preview

Comments


Category
State
  • 현재 접속자 17 명
  • 오늘 방문자 1,128 명
  • 어제 방문자 2,010 명
  • 최대 방문자 7,216 명
  • 전체 방문자 1,662,577 명
  • 전체 게시물 33,730 개
  • 전체 댓글수 47 개
  • 전체 회원수 520 명
Facebook Twitter GooglePlus KakaoStory NaverBand