Feedback

Defined under the namespace Scandit.Datacapture.Core

Vibration
class Vibration

Added in version 6.13.0

A vibration, to be emitted for example when a code has been successfully scanned.

Some browsers do not support emitting vibration (see current support <https://caniuse.com/vibration>_). On such browsers using this class has no effect.

defaultVibration
static get defaultVibration(): Vibration

Added in version 6.13.0

The default vibration for a successful scan.

Sound
class Sound

Added in version 6.13.0

A sound, to be played for example when a code has been successfully scanned.

resource
resource: string | null

Added in version 6.13.0

The name of the resource file, including the extension.

On iOS, the file must be added as a resource file, on Android it must be added specifically under app/src/main/assets.

defaultSound()
static get defaultSound(): Sound

Added in version 6.13.0

The default beep sound for a successful scan.

Feedback
class Feedback

Added in version 6.13.0

A feedback consisting of a sound and vibration, for example to be provided by a device when a code has been successfully scanned.

Some browsers do not support emitting vibration (see current support <https://caniuse.com/vibration>_). On such browsers only the sound is played - using vibration has no effect.

defaultFeedback()
static get defaultFeedback(): Feedback

Added in version 6.13.0

The default feedback consisting of a default sound and a default vibration.

sound
get sound(): Sound | null

Added in version 6.13.0

The sound to be played when a feedback is required. If null, no sound is played. Depending on the device’s ring mode and/or volume settings, no sound may be played even if this property is properly set to a non-null instance.

vibration
get vibration(): Vibration | null

Added in version 6.13.0

The vibration to be emitted when a feedback is required. If null, no vibration is emitted. This property is further influenced by the device’s ring mode: the device may not vibrate even if this property is properly set to a non-null instance.

constructor(vibration, sound)
constructor(vibration: Vibration | null,
        sound: Sound | null)

Added in version 6.13.0

Creates a Feedback that emits the given vibration and plays the given sound.

emit()
emit(): void

Added in version 6.13.0

Emits the feedback defined by this object. This method is further influenced by the device’s ring mode and/or volume settings - check sound and vibration for more details.