Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@jonz94/capacitor-image-picker
Advanced tools
Readme
@jonz94/capacitor-image-picker
Capacitor plugin for multiple image selection.
npm install @jonz94/capacitor-image-picker
npx cap sync
This plugin uses a forked version of YPImagePicker under the hood.
In order to use this plugin, you need to manually modified ios/App/Podfile
as following:
target 'App' do
capacitor_pods
# Add your Pods here
+ pod 'YPImagePicker', :git => 'https://github.com/jonz94/YPImagePicker.git', :tag => '5.2.2.0'
end
After modified ios/App/Podfile
, make sure to run pod update
command to sync up the iOS project.
iOS requires the following usage description be added and filled out for your app in Info.plist
:
NSPhotoLibraryUsageDescription
(Privacy - Photo Library Usage Description
)Read about Configuring Info.plist
in the iOS Guide for more information on setting iOS permissions in Xcode.
This plugin uses a forked version of TedImagePicker under the hood.
Add following line to your android/build.gradle
:
allprojects {
repositories {
google()
mavenCentral()
+ maven { url "https://jitpack.io" }
}
}
Add following lines to your android/app/build.gradle
:
android {
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
// ...
}
buildTypes {
// ...
}
+ dataBinding {
+ enabled true
+ }
}
After modified android/build.gradle
and android/app/build.gradle
, make sure to run Sync Project with Gradle Files
in Android Studio.
This plugin requires the following permissions be added to your AndroidManifest.xml
:
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
The storage permissions are for reading photo files.
Read about Setting Permissions in the Android Guide for more information on setting Android permissions.
No configuration required for this plugin.
import { ImagePicker } from '@jonz94/capacitor-image-picker';
const pickSingleImage = async () => {
const { images } = await ImagePicker.present();
// console.log(images[0]);
return images[0];
}
const pickMultipleImages = async () => {
const { images } = await ImagePicker.present({ limit: 10 });
// console.log(images);
return images;
}
const pickMultipleImagesWithCustomText = async () => {
const { images } = await ImagePicker.present({
limit: 10,
surpassLimitMessage: 'You cannot select more than %d images.',
titleText: 'Pick a image',
albumsTitleText: 'Chose an album',
libraryTitleText: 'Click here to change library',
cancelText: 'Go Back',
doneText: 'OK',
});
// console.log(images);
return images;
}
present(options?: PresentOptions | undefined) => Promise<Images>
Param | Type |
---|---|
options | PresentOptions |
Returns: Promise<Images>
Prop | Type | Description | Since |
---|---|---|---|
images | Image[] | Array of all the picked images. | 1.0.0 |
Prop | Type | Description | Since |
---|---|---|---|
path | string | The file path of the image. | 1.0.0 |
webPath | string | webPath returns a path that can be used to set the src attribute of an image for efficient loading and rendering. | 1.0.0 |
mimeType | string | The mime type of the image. | 1.0.0 |
Prop | Type | Description | Default | Since |
---|---|---|---|---|
limit | number | Maximum number of images the user will be able to choose. Note: If this is set to 1, upon selection of a single image. | 1 | 1.0.0 |
surpassLimitMessage | string | The message when user select more than maximum number of pictures. This message will not occur when limit is 1. Note: The message MUST INCLUDE ONE AND ONLY ONE %d as a placeholder for showing the value of limit . | "You can only select %d images." | 1.0.0 |
titleText | string | Android only: The title of the image picker. | "Select Image" | 1.0.0 |
albumAllText | string | Android only: name of the all photos album. | "All" | 1.2.0 |
libraryTitleText | string | iOS only: The title of the library. | "Library" | 1.0.0 |
albumsTitleText | string | iOS only: The title of the albums. | "Albums" | 1.0.0 |
cancelText | string | iOS only: The text to display on the cancel button. Note: on Android, the cancel button is shown as icon-only back button with no text. | "Cancel" | 1.0.0 |
doneText | string | The text to display on the done button. | "Done" | 1.0.0 |
See CHANGELOG.md.
See LICENSE.
saveTemporaryImage()
implementation on iOS.getMimeTypeFromURL()
implementation on iOS.FAQs
Capacitor plugin for multiple image selection
The npm package @jonz94/capacitor-image-picker receives a total of 9 weekly downloads. As such, @jonz94/capacitor-image-picker popularity was classified as not popular.
We found that @jonz94/capacitor-image-picker demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.