PortOne SDK for React Native
npm install @portone/react-native-sdkReact Native 환경에서 포트원 V2 결제 시스템에 연동하기 위한 SDK입니다.
Node.js v18을 지원하며, Expo 51.0.38과 react-native-webview 13.8.6 환경에서
테스트되었습니다.
- tech.support@portone.io
1. Expo CLI를 사용해 @portone/react-native-sdk와 의존성인 react-native-webview,
expo-intent-launcher을 설치합니다.
``shell`
npx expo install @portone/react-native-sdk react-native-webview expo-intent-launcher
2. TypeScript를 사용하시는 경우 @portone/browser-sdk를 devDependencies에
추가합니다.
`shell`
npm install --save-dev @portone/browser-sdk
yarn add -D @portone/browser-sdk
3. app.json의 plugin 항목으로 @portone/react-native-sdk/plugin를 추가합니다.
이 플러그인은 앱 링크를 사용하기 위한 AndroidManifest.xml 및 Info.plist 설정을 자동으로 추가합니다.
단, iOS 15 이상 버전에서 Info.plist 설정에는 최대 50개의 LSApplicationQueriesSchemes 항목만이 적용되므로
일부 앱 링크만이 열리지 않는 등의 문제가 발생하실 경우 플러그인을 제거하고 필요한 항목만을 골라 직접 설정해주세요.
`json`
{
"expo": {
"plugins": ["@portone/react-native-sdk/plugin"]
}
}
4. TypeScript를 사용하시는 경우 tsconfig.json에 다음 항목을 추가 혹은
수정합니다.
`json`
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
1. @portone/react-native-sdk와 의존성인 react-native-webview,
expo-intent-launcher을 설치합니다.
`shell`
npm install --save @portone/react-native-sdk react-native-webview expo-intent-launcher
yarn add @portone/react-native-sdk react-native-webview expo-intent-launcher
2. ios 서브디렉토리에서 pod를 사용해 react-native-webview에 필요한 네이티브
의존성을 링킹힙니다.
`sh`
pod install
3. TypeScript를 사용하시는 경우 @portone/browser-sdk를 devDependencies에
추가합니다.
`shell`
npm install --save-dev @portone/browser-sdk
yarn add -D @portone/browser-sdk
4. TypeScript를 사용하시는 경우 tsconfig.json에 다음 항목을 추가 혹은
수정합니다.
`json`
"compilerOptions": {
"module": "NodeNext",
"moduleResolution": "NodeNext"
}
5. 앱 링크를 사용하기 위해 android/app/src/main/AndroidManifest.xml 파일에 아래
내용을 추가합니다.
`xml`
6. 앱 링크를 사용하기 위해 ios/(프로젝트 이름)/Info.plist 파일에 아래 내용을 추가합니다.
iOS 15 이상 버전에서는 최대 50개의 항목만이 적용되므로, 필요한 항목만을 추가합니다.
`xml`
`js
import {
IdentityVerification,
IssueBillingKey,
IssueBillingKeyAndPay,
Payment,
IssueBillingKeyUI,
PaymentUI,
} from '@portone/react-native-sdk'
``
세부 사용법과 관련하여
React Native 포트원 샘플 프로젝트
및
React Native Expo 포트원 샘플 프로젝트를
참고하실 수 있습니다.
---
Made with
create-react-native-library
Packages under _portone-io/react-native-sdk_ are primarily distributed under the
terms of both the [Apache License (Version 2.0)] and the [MIT license]. See
[COPYRIGHT] for details.
[MIT license]: LICENSE-MIT
[Apache License (Version 2.0)]: LICENSE-APACHE
[COPYRIGHT]: COPYRIGHT