Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.3
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
10.6
Statistic
FMM
Blog
ImagePicker.IsSourceTypeAvailable
Check for source availability.
| Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
| ImagePicker | 7.3 | No | No | No | No | Yes |
Parameters
| Parameter | Description | Example |
|---|---|---|
| sourceType | The source to use to pick an image. Can be PhotoLibrary, Camera or SavedPhotosAlbum. |
"Camera" |
Result
Returns OK or error.
Description
Check for source availability.Returns a Boolean value indicating whether the device supports picking media using the specified source type.
1 if the device supports the specified source type; 0 if the specified source type is not available.
Because a media source may not be present or may be unavailable, devices may not always support all source types. For example, if you attempt to pick an image from the user’s library and the library is empty, this method returns 0. Similarly, if the camera is already in use, this method returns 0.
Before attempting to use an ImagePickerController object to pick an image, you must call this method to ensure that the desired source type is available.
Examples
Check for source type being available:
Set Variable [ $SourceType ; Value: Get(ScriptParameter) ]
Set Variable [ $r ; Value: MBS( "ImagePicker.IsSourceTypeAvailable"; $sourceType ) ]
If [ $r ≠ 1 ]
Show Custom Dialog [ "Can't pick picture." ; "The source " & $sourceType & " is not available." ]
Exit Script [ Text Result: "failed" ]
End If
See also
Example Databases
Blog Entries
Created 17th June 2017, last changed 20th June 2017
ImagePicker.IsPresented - ImagePicker.MediaCropRect
Feedback: Report problem or ask question.
Links
MBS FileMaker blog