cancel
Showing results for 
Search instead for 
Did you mean: 

How to specify the media types in FUIAttachmentsFormCell?

0 Kudos

Hi

I am using FUIAttachmentsFormCell in my projects in many modules. I have to upload only images to the backend. so I have to restrict selecting videos from iOS photo library. This is possible in iOS UIImagePickerController API. We can control the camera mode.

let imagePickerController = UIImagePickerController()
imagePickerController.mediaTypes = [kUTTypeImage, kUTTypeGIF, kUTTypeBMP] as [String]        imagePickerController.cameraDevice = .rear

How to do set the attributes FUIAttachmentFormCell?

SDK Used: v3.2.7

Accepted Solutions (0)

Answers (3)

Answers (3)

AlexGiguere
Contributor

Hi, I did not try the attachment API yet, but it looks like you can filter out,

check the FUIDocumentPickerAttachmentAction

and it's delegate FUIDocumentPickerAttachmentActionDelegate

https://help.sap.com/doc/978e4f6c968c4cc5a30f9d324aa4b1d7/3.0/en-US/Documents/Frameworks/SAPFiori/Cl...

you can return an instance of UIDocumentPickerViewController, take the init where you can supply an array of document types

https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller

alex

0 Kudos

@Alexandre Giguere there is no issue while opening document picker. I have issue in PhotoAction. FUIAddPhotoAttachmentAction and should have configuration to filter media types. This feature is missed in SAP Cloud platform for iOS SDK.

jan-hua_chu
Explorer
0 Kudos

In SAPFiori 4.0 release, there is a new property in the FUIAddPhotoAttachmentAction which allows developers to choose the media types to be used:

/**

The types of media that are allowed.

Use this property to customize the media types allowed for this attachment action.

If this is not specified, the default is:

``` swift

[kUTTypeMovie as String, kUTTypeImage as String]

```

This means both video and photo are allowed to be chosen.

Constants `kUTTypeMovie` and `kUTTypeImage` are defined in `MobileCoreServices`.

*/

public var mediaTypes: [String]?

former_member190800
Contributor
0 Kudos

@Mahabaleshwar Hegde checking with the developer.