Since

4.1.5

This class provides access to documents.

Example

import DocumentPicker from '@smartface/native/device/documentpicker';

DocumentPicker.pick({
page,
type: [DocumentPicker.Types.PDF],
onSuccess: function (file) {
console.log("onSuccess : ",file.path);
},
onCancel: function () {
console.log("onCancel");
}
});

Hierarchy

  • Documentpicker

Properties

Methods

Constructors

Properties

Types: typeof Types = Types

Device.DocumentPicker.Types

Since

4.1.5

Android

Ios

Provides a few common types for use as type values.

Methods

  • Use pick to open a document picker for the user to select file.

    Method

    pick

    Android

    Ios

    Since

    4.1.5

    Parameters

    • params: { page: PageImpl; type: Types[]; onSuccess: ((file: FileImpl) => void); onCancel: (() => void); onFailure: ((e?: Error) => void) }
      • page: PageImpl
      • type: Types[]

        On Android these are MIME types such as text/plain or partial MIME types such as image/*. On iOS these must be Apple "Uniform Type Identifiers". Also can use Device.DocumentPicker.Types.

      • onSuccess: ((file: FileImpl) => void)
          • (file: FileImpl): void
          • This event is called after picking document successfully.

            Parameters

            • file: FileImpl

            Returns void

      • onCancel: (() => void)
          • (): void
          • If the user cancels the document picker without choosing a file (by pressing the system back button on Android or the Cancel button on iOS) the Promise will be rejected with a cancellation error.

            Returns void

      • onFailure: ((e?: Error) => void)
          • (e?: Error): void
          • Android only, if any runtime error occures, this method will be called. This method will be ignored on iOS

            Parameters

            • Optional e: Error

            Returns void

    Returns void

Constructors

Generated using TypeDoc