Skip to content

Commit c9dc3fd

Browse files
committed
📝 Declare NSPhotoLibraryAddUsageDescription usages
1 parent 388e219 commit c9dc3fd

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README-ZH.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Language: [English](README.md) | 中文
6262
* [开始前的注意事项 ‼️](#开始前的注意事项-)
6363
* [准备工作 🍭](#准备工作-)
6464
* [配置](#配置)
65+
* [特别提醒 📝](#特别提醒-)
6566
* [使用方法 📖](#使用方法-)
6667
* [国际化](#国际化)
6768
* [简单的使用方法](#简单的使用方法)
@@ -143,6 +144,12 @@ dependencies:
143144
import 'package:wechat_camera_picker/wechat_camera_picker.dart';
144145
```
145146

147+
### 特别提醒 📝
148+
149+
1. 在 iOS 上使用 `NSPhotoLibraryAddUsageDescription` 时,
150+
需要使用 `onEntitySaving``onXFileCaptured` 来处理捕获的文件,
151+
在这种情况下 `AssetEntity` 不可用,使用其 ID 获取该资源将导致崩溃。
152+
146153
## 使用方法 📖
147154

148155
### 国际化

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ submit issues to our issue tracker first.
6363
* [READ THIS FIRST ‼️](#read-this-first-)
6464
* [Preparing for use 🍭](#preparing-for-use-)
6565
* [Setup](#setup)
66+
* [Notes 📝](#notes-)
6667
* [Usage 📖](#usage-)
6768
* [Localizations](#localizations)
6869
* [Simple usage](#simple-usage)
@@ -141,6 +142,13 @@ Follow these detailed setup guide before runs:
141142
- [wechat_assets_picker#preparing-for-use](https://github.com/fluttercandies/flutter_wechat_assets_picker#preparing-for-use-)
142143
- [camera#installation](https://pub.dev/packages/camera#installation)
143144
145+
#### Notes 📝
146+
147+
1. When using `NSPhotoLibraryAddUsageDescription` on iOS,
148+
it requires using `onEntitySaving` or `onXFileCaptured` to handle the captured file,
149+
an `AssetEntity` is not available in this circumstance,
150+
obtaining that asset with its ID will lead to a crash.
151+
144152
Then import the package in your code:
145153
```dart
146154
import 'package:wechat_camera_picker/wechat_camera_picker.dart';

0 commit comments

Comments
 (0)