`cordova` 图片多选插件, 也兼容 `capacitor`;
基于[cordova-plugin-telerik-imagepicker](https://www.npmjs.com/package/cordova-plugin-telerik-imagepicker)插件修改; 使用请参考原文；

如果使用ionic，安装方式：
```shell
npm i @ionic-native/image-picker
ionic cordova plugin add cordova-plugin-flyff-imagepicker
```

# 版本限制
1.x:
```xml
<!-- cordova-android ">=5 <9" -->
<engine name="cordova-android" version="5.0.0 - 8" />
```

2.x:
```xml
<!-- cordova-android ">=9 <12" -->
<engine name="cordova-android" version="9.0.0 - 11" />
```

# 注意事项

`cordova`需要在`config.xml`添加权限配置
```xml
<!-- android -->
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
    <application android:requestLegacyExternalStorage="true" />
</edit-config>
<!-- ios -->
<config-file parent="NSCameraUsageDescription" target="*-Info.plist">
    <string>需要您的同意才能在使用签收功能时选择照片上传，如果不同意会导致无法使用照片证明收到货。</string>
</config-file>
<config-file parent="NSPhotoLibraryUsageDescription" target="*-Info.plist">
    <string>需要您的同意才能在使用签收功能时选择照片上传，如果不同意会导致无法使用照片证明收到货。</string>
</config-file>
```

`capacitor`需要在原生项目手动配置；


# 1.x调整

## iOS

### 缩略图主线程渲染
使用GCD库调用主线程进行渲染; 涉及方法：
```objc
// GMGridViewController.m
- (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath;
```

### 图片选择未授权的情况
调整为，等授权完再重新执行一次方法; 涉及方法：
```objc
// SOSPicker.m
- (void) requestReadPermission:(CDVInvokedUrlCommand *)command;
```

### 本地化增加中文
添加了`zh-Hans.lproj`文件夹

## Android

### 本地化增加中文
添加了`values-zh`文件文件夹

# 2.x调整

## Android

### 支持AndroidX

`MultiImageChooserActivity.java`改动:
```diff
# android.support.v7 => androidx.appcompat
- import android.support.v7.app.ActionBar;
- import android.support.v7.app.AppCompatActivity;
+ import androidx.appcompat.app.ActionBar;
+ import androidx.appcompat.app.AppCompatActivity;
# ImageView不支持了
- private class SquareImageView extends ImageView
+ private class SquareImageView extends androidx.appcompat.widget.AppCompatImageView
```

`ImagePicker.java`改动:
```diff
# android.support.v4 => androidx.core
- import android.support.v4.app.ActivityCompat
- import android.support.v4.content.ContextCompat;
+ import androidx.core.app.ActivityCompat;
+ import androidx.core.content.ContextCompat;
```

### 相册权限
请求权限的方式改成使用`cordova`提供的接口

### 修改plugin.xml

注释代码:
```xml
<!-- 添加安卓时出现错误：`Cannot read property 'find' of null`； -->
<resource-file src="src/android/Library/res/values/themes.xml" target="res/values/themes.xml"/>
<!-- 合并出错 -->
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
    <application android:requestLegacyExternalStorage="true" />
</edit-config>
```
