react-native-attachment-kit 1.0.13 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/ios/README.md +0 -213
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.14 — 2026-10-21
|
|
4
|
+
|
|
5
|
+
- No code changes from 1.0.13. Published automatically by GitHub Actions (npm trusted publishing).
|
|
6
|
+
|
|
3
7
|
## 1.0.13 — 2026-10-21
|
|
4
8
|
|
|
5
9
|
- iOS: fixed a crash when closing the picker (`-[AVCaptureSession stopRunning]` exception). The full-screen camera's front/back flip now runs on the same camera session queue as the gallery camera, so stopping the camera can no longer overlap a session reconfiguration.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-attachment-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "Native attachment kit for React Native — gallery picker, editor, image viewer and media gallery (Turbo Module)",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
package/ios/README.md
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
# RNAttachmentKit
|
|
2
|
-
|
|
3
|
-
고성능 텔레그램 스타일 이미지 갤러리 피커 for React Native
|
|
4
|
-
|
|
5
|
-
## 🚀 주요 기능
|
|
6
|
-
|
|
7
|
-
- ✅ **고성능**: 배치 로딩과 캐싱으로 빠른 성능
|
|
8
|
-
- ✅ **다중 선택**: 여러 이미지 동시 선택 가능
|
|
9
|
-
- ✅ **앨범 지원**: 스마트 앨범 및 사용자 앨범 지원
|
|
10
|
-
- ✅ **품질 옵션**: low, medium, high 품질 선택
|
|
11
|
-
- ✅ **TypeScript**: 완벽한 타입 정의
|
|
12
|
-
- ✅ **iOS 15.1+**: 최신 iOS 지원
|
|
13
|
-
|
|
14
|
-
## 📦 설치
|
|
15
|
-
|
|
16
|
-
### 1. 프로젝트에 모듈 추가
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
cd /path/to/your/react-native-project
|
|
20
|
-
|
|
21
|
-
# package.json에 로컬 모듈 추가
|
|
22
|
-
yarn add file:../NativeModules/RNAttachmentKit/ios
|
|
23
|
-
# 또는
|
|
24
|
-
npm install file:../NativeModules/RNAttachmentKit/ios
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### 2. iOS Pod 설치
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
cd ios
|
|
31
|
-
pod install
|
|
32
|
-
cd ..
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
### 3. iOS 권한 설정
|
|
36
|
-
|
|
37
|
-
`ios/YourApp/Info.plist` 파일에 다음 권한 추가:
|
|
38
|
-
|
|
39
|
-
```xml
|
|
40
|
-
<key>NSPhotoLibraryUsageDescription</key>
|
|
41
|
-
<string>사진을 선택하기 위해 라이브러리 접근이 필요합니다.</string>
|
|
42
|
-
<key>NSPhotoLibraryAddUsageDescription</key>
|
|
43
|
-
<string>사진을 저장하기 위해 라이브러리 접근이 필요합니다.</string>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## 📱 사용법
|
|
47
|
-
|
|
48
|
-
### 기본 사용
|
|
49
|
-
|
|
50
|
-
```typescript
|
|
51
|
-
import { RNAttachmentKit } from 'react-native-attachment-kit';
|
|
52
|
-
|
|
53
|
-
// 1. 권한 체크
|
|
54
|
-
const status = await RNAttachmentKit.checkPermission();
|
|
55
|
-
|
|
56
|
-
if (status.status !== 'authorized') {
|
|
57
|
-
// 2. 권한 요청
|
|
58
|
-
const result = await RNAttachmentKit.requestPermission();
|
|
59
|
-
if (result.status !== 'authorized') {
|
|
60
|
-
console.log('권한이 거부되었습니다.');
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// 3. 갤러리 열기
|
|
66
|
-
try {
|
|
67
|
-
const result = await RNAttachmentKit.openGallery({
|
|
68
|
-
maxSelection: 10,
|
|
69
|
-
quality: 'high',
|
|
70
|
-
includeBase64: false,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
console.log('선택된 이미지:', result.images);
|
|
74
|
-
} catch (error) {
|
|
75
|
-
if (error.code === 'USER_CANCELLED') {
|
|
76
|
-
console.log('사용자가 취소했습니다.');
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### 옵션
|
|
82
|
-
|
|
83
|
-
```typescript
|
|
84
|
-
interface ImagePickerOptions {
|
|
85
|
-
maxSelection?: number; // 최대 선택 가능 개수 (기본값: 10)
|
|
86
|
-
quality?: 'low' | 'medium' | 'high'; // 이미지 품질 (기본값: 'high')
|
|
87
|
-
includeBase64?: boolean; // Base64 포함 여부 (기본값: false)
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### 반환 타입
|
|
92
|
-
|
|
93
|
-
```typescript
|
|
94
|
-
interface ImageAsset {
|
|
95
|
-
uri: string; // 파일 경로 (file://)
|
|
96
|
-
filename: string; // 파일 이름
|
|
97
|
-
width: number; // 이미지 너비
|
|
98
|
-
height: number; // 이미지 높이
|
|
99
|
-
fileSize: number; // 파일 크기 (bytes)
|
|
100
|
-
type: string; // MIME 타입 (image/jpeg)
|
|
101
|
-
base64?: string; // Base64 문자열 (옵션)
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
interface ImagePickerResult {
|
|
105
|
-
images: ImageAsset[];
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## 🎨 전체 예제
|
|
110
|
-
|
|
111
|
-
전체 예제는 `/example/ImagePickerExample.tsx` 파일을 참고하세요.
|
|
112
|
-
|
|
113
|
-
## 🔧 개발
|
|
114
|
-
|
|
115
|
-
### 프로젝트 구조
|
|
116
|
-
|
|
117
|
-
```
|
|
118
|
-
RNAttachmentKit/
|
|
119
|
-
├── ios/
|
|
120
|
-
│ ├── RNAttachmentKit/ # iOS 네이티브 코드
|
|
121
|
-
│ │ ├── PhotoManager.swift # 사진 관리자
|
|
122
|
-
│ │ ├── GalleryViewController.swift
|
|
123
|
-
│ │ └── ...
|
|
124
|
-
│ ├── ios/ # RN 브리지
|
|
125
|
-
│ │ ├── RNAttachmentKitModule.swift
|
|
126
|
-
│ │ └── RNAttachmentKitModule.m
|
|
127
|
-
│ ├── src/ # TypeScript 인터페이스
|
|
128
|
-
│ │ └── index.ts
|
|
129
|
-
│ ├── package.json
|
|
130
|
-
│ └── RNAttachmentKit.podspec
|
|
131
|
-
└── android/ # (향후 추가 예정)
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### 로컬 개발
|
|
135
|
-
|
|
136
|
-
```bash
|
|
137
|
-
# 1. 네이티브 코드 수정 후
|
|
138
|
-
cd /path/to/PaceLap.ReactNative/ios
|
|
139
|
-
pod install
|
|
140
|
-
|
|
141
|
-
# 2. React Native 빌드
|
|
142
|
-
cd ..
|
|
143
|
-
yarn ios
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
## 📝 API 문서
|
|
147
|
-
|
|
148
|
-
### `requestPermission()`
|
|
149
|
-
|
|
150
|
-
포토 라이브러리 권한을 요청합니다.
|
|
151
|
-
|
|
152
|
-
```typescript
|
|
153
|
-
const result = await RNAttachmentKit.requestPermission();
|
|
154
|
-
// { status: 'authorized' | 'denied' | 'restricted' | 'notDetermined' }
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### `checkPermission()`
|
|
158
|
-
|
|
159
|
-
현재 권한 상태를 확인합니다.
|
|
160
|
-
|
|
161
|
-
```typescript
|
|
162
|
-
const result = await RNAttachmentKit.checkPermission();
|
|
163
|
-
// { status: 'authorized' | 'denied' | 'restricted' | 'notDetermined' }
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### `openGallery(options)`
|
|
167
|
-
|
|
168
|
-
이미지 갤러리를 엽니다.
|
|
169
|
-
|
|
170
|
-
```typescript
|
|
171
|
-
const result = await RNAttachmentKit.openGallery({
|
|
172
|
-
maxSelection: 10,
|
|
173
|
-
quality: 'high',
|
|
174
|
-
includeBase64: false,
|
|
175
|
-
});
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
## 🐛 트러블슈팅
|
|
179
|
-
|
|
180
|
-
### Pod install 실패
|
|
181
|
-
|
|
182
|
-
```bash
|
|
183
|
-
cd ios
|
|
184
|
-
rm -rf Pods Podfile.lock
|
|
185
|
-
pod cache clean --all
|
|
186
|
-
pod install
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
### 모듈을 찾을 수 없음
|
|
190
|
-
|
|
191
|
-
```bash
|
|
192
|
-
# node_modules 재설치
|
|
193
|
-
rm -rf node_modules
|
|
194
|
-
yarn install
|
|
195
|
-
|
|
196
|
-
# iOS 클린 빌드
|
|
197
|
-
cd ios
|
|
198
|
-
xcodebuild clean
|
|
199
|
-
cd ..
|
|
200
|
-
yarn ios
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### 권한이 작동하지 않음
|
|
204
|
-
|
|
205
|
-
Info.plist에 `NSPhotoLibraryUsageDescription` 권한이 추가되었는지 확인하세요.
|
|
206
|
-
|
|
207
|
-
## 📄 라이선스
|
|
208
|
-
|
|
209
|
-
MIT
|
|
210
|
-
|
|
211
|
-
## 👨💻 Author
|
|
212
|
-
|
|
213
|
-
Mike
|