with-rn-image-crop-picker
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -5,10 +5,12 @@ "use strict"; | ||
const config_plugins_1 = require("@expo/config-plugins"); | ||
const withImageCropPicker = (config) => { | ||
const withImageCropPicker = (config, { PhotoLibraryUsageDescription, CameraUsageDescription, MicrophoneUsageDescription, } = {}) => { | ||
const photoDescription = PhotoLibraryUsageDescription || | ||
"Allow $(PRODUCT_NAME) to access your photo library"; | ||
const CameraDescription = CameraUsageDescription || "Allow $(PRODUCT_NAME) to access your camera"; | ||
const MicrophoneDescription = MicrophoneUsageDescription || | ||
"Allow $(PRODUCT_NAME) to access your microphone"; | ||
return (0, config_plugins_1.withInfoPlist)(config, (config) => { | ||
config.modResults.NSPhotoLibraryUsageDescription = | ||
"Allow $(PRODUCT_NAME) to access your photo library"; | ||
config.modResults.NSCameraUsageDescription = | ||
"Allow $(PRODUCT_NAME) to access your camera"; | ||
config.modResults.NSMicrophoneUsageDescription = | ||
"Allow $(PRODUCT_NAME) to access your microphone"; | ||
config.modResults.NSPhotoLibraryUsageDescription = photoDescription; | ||
config.modResults.NSCameraUsageDescription = CameraDescription; | ||
config.modResults.NSMicrophoneUsageDescription = MicrophoneDescription; | ||
return config; | ||
@@ -15,0 +17,0 @@ }); |
33
index.ts
import { ConfigPlugin, withInfoPlist } from "@expo/config-plugins"; | ||
export const withImageCropPicker: ConfigPlugin<string> = (config) => { | ||
interface PluginProps { | ||
PhotoLibraryUsageDescription?: string; | ||
CameraUsageDescription?: string; | ||
MicrophoneUsageDescription?: string; | ||
} | ||
export const withImageCropPicker: ConfigPlugin<PluginProps> = ( | ||
config, | ||
{ | ||
PhotoLibraryUsageDescription, | ||
CameraUsageDescription, | ||
MicrophoneUsageDescription, | ||
} = {} | ||
) => { | ||
const photoDescription = | ||
PhotoLibraryUsageDescription || | ||
"Allow $(PRODUCT_NAME) to access your photo library"; | ||
const CameraDescription = | ||
CameraUsageDescription || "Allow $(PRODUCT_NAME) to access your camera"; | ||
const MicrophoneDescription = | ||
MicrophoneUsageDescription || | ||
"Allow $(PRODUCT_NAME) to access your microphone"; | ||
return withInfoPlist(config, (config) => { | ||
config.modResults.NSPhotoLibraryUsageDescription = | ||
"Allow $(PRODUCT_NAME) to access your photo library"; | ||
config.modResults.NSCameraUsageDescription = | ||
"Allow $(PRODUCT_NAME) to access your camera"; | ||
config.modResults.NSMicrophoneUsageDescription = | ||
"Allow $(PRODUCT_NAME) to access your microphone"; | ||
config.modResults.NSPhotoLibraryUsageDescription = photoDescription; | ||
config.modResults.NSCameraUsageDescription = CameraDescription; | ||
config.modResults.NSMicrophoneUsageDescription = MicrophoneDescription; | ||
@@ -12,0 +31,0 @@ return config; |
{ | ||
"name": "with-rn-image-crop-picker", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"homepage": "https://github.com/mwegener-com/with-rn-image-crop-picker#readme", | ||
@@ -5,0 +5,0 @@ "author": "Marius Wegener", |
@@ -26,7 +26,30 @@ # with-rn-image-crop-picker | ||
$ expo prebuild | ||
$ expo run:ios --devive | ||
$ expo run:ios --device | ||
``` | ||
# Configuartion | ||
You can configure the iOS messages by adding the following props: | ||
- PhotoLibraryUsageDescription | ||
- CameraUsageDescription | ||
- MicrophoneUsageDescription | ||
Example: | ||
```javascript | ||
"plugins": [ | ||
[ | ||
"with-rn-image-crop-picker", | ||
{ | ||
"PhotoLibraryUsageDescription": "Allow app XYZ to access your photos", | ||
"CameraUsageDescription": "Allow app XYZ to access your camera", | ||
"MicrophoneUsageDescription": "Allow app XYZ to access your microphone" | ||
} | ||
] | ||
], | ||
``` | ||
# Contributing | ||
Contributions are very welcome!. | ||
Contributions are very welcome! |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5473
8
66
55