Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

ImagePicker.IsSourceTypeAvailable

Check for source availability.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
ImagePicker 7.3 No No No No Yes

MBS( "ImagePicker.IsSourceTypeAvailable"; sourceType )

Parameters

Parameter Description Example value
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


ImagePicker.IsPresented   -   ImagePicker.MediaCropRect

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins