Exemplo n.º 1
0
        /// <summary>
        /// Cleanup the temp plugin folder, and returns details about the cleanup.
        /// </summary>
        /// <param name="preview">If set to true, no deletion will happen. Use this to get a preview of what files would be deleted.</param>
        /// <returns>Result of the cleanup process with with all the details.</returns>
        public static IIosImagePickerCleanupResult CleanupPluginFolder(bool preview)
        {
#if IOS_IMAGE_PICKER_NATIVE_IMPLEMENTATION_AVAILABLE
            var jsonPayload = PInvoke.UnityIosImagePickerController_CleanupTempFolder(preview);
            return(NativePayloadDeserializer.DeserializeIosImageCleanupResult(jsonPayload));
#else
            return(null);
#endif
        }
Exemplo n.º 2
0
        public void Present(IosImagePickerPresentArgs presentArgs, Action <IIosImagePickerResult> resultCallback)
        {
#if IOS_IMAGE_PICKER_NATIVE_IMPLEMENTATION_AVAILABLE
            var requestId = CallbackHandler.AddCallback(payload =>
            {
                var result = NativePayloadDeserializer.DeserializeIosImagePickerResult(payload);
                resultCallback.Invoke(result);
            });

            var mediaTypes = this.MediaTypes;
            if (mediaTypes == null)
            {
                mediaTypes = AvailableMediaTypesForSourceType(this.SourceType);
            }

            var serializedMediaTypes = string.Join(SerializationSeparator.ToString(), mediaTypes);

            PInvoke.UnityIosImagePickerController_Present(
                requestId,
                this.SourceType,
                serializedMediaTypes,
                this.AllowsEditing,
                this.VideoQuality,
                this.VideoMaximumDuration.TotalSeconds,
                this.CameraDevice,
                this.CameraCaptureMode,
                this.CameraFlashMode,
                presentArgs.IpadPopoverPermittedArrowDirections,
                presentArgs.IpadNormalizedPopoverSourceRect.x,
                presentArgs.IpadNormalizedPopoverSourceRect.y,
                presentArgs.IpadNormalizedPopoverSourceRect.width,
                presentArgs.IpadNormalizedPopoverSourceRect.height,
                presentArgs.IpadPopoverCanOverlapSourceRect);
#else
            throw new Exception("Ios Image Picker not supported in this platform");
#endif
        }