Since

0.1

System provides operating system specific information of the device.

Example

import System from '@smartface/native/device/system';
console.log("Device.System.OS: " + System.OS);
console.log("Device.System.OSVersion: " + System.OSVersion);
console.log("Device.System.android.apiLevel: " + System.android.apiLevel);
console.log("Device.System.batteryLevel: " + System.batteryLevel);
console.log("Device.System.isBatteryCharged: " + System.isBatteryCharged);
console.log("Device.System.clipboard: " + System.clipboard);
console.log("Device.System.language: " + System.language);
console.log("Device.System.region: " + System.region);
console.log("Device.System.android.isApplicationInstalled: " + System.android.isApplicationInstalled('io.smartface.SmartfaceApp'));
console.log("Device.System.vibrate(): " + System.vibrate());
console.log("Device.System.android.menuKeyAvaliable: " + System.android.menuKeyAvaliable);
console.log("Device.System.fingerPrintAvailable: " + System.fingerPrintAvailable);

Hierarchy

  • System

Properties

appearance: Appearance

Returns the device's appearance.

Property

Static

Android

Ios

Since

5.0.7

OS: OSType

Determines which operating system is currently running.

Example

import System from '@smartface/native/device/system';
if(System.OS === System.OSType.Android) {
console.log("It is Android");
}
OSType: typeof OSType

Determines which operating system is currently running.

Example

import System from '@smartface/native/device/system';
if(System.OS === System.OSType.Android) {
console.log("It is Android");
}
language: string

Returns the device's current language set.

Property

Static

Android

Ios

Since

0.1

region: string

Returns the device's current region.

Property

Static

Android

Ios

Since

2.0.7

batteryLevel: string

Returns the battery level of the device in percentage.

Property

Static

Android

Ios

Since

0.1

isBatteryCharged: boolean

Indicates whether the device is charged or not.

Property

Android

Ios

Static

Since

0.1

OSVersion: string

Returns the operating system version of the device.

Property

Android

Ios

Static

Since

0.1

biometricType: BiometryType

Returns the set of available biometric authentication supported by the device.

Property

Ios

Android

Static

Since

4.3.1

android: Partial<{ apiLevel: number; supported64BitAbis?: String[]; supported32BitAbis?: String[]; menuKeyAvaliable?: number; getPackageVersion?: any }>
ios: Partial<{ fingerPrintAvaliable: boolean; validateFingerPrint: any }>
fingerPrintAvailable: boolean

Return value shows that if the device supports feature or not. Also it would be show that fingerprint (for Android) or TouchID (for iOS) is defined or not defined on the phone, You need to add Application.android.Permissions#USE_FINGERPRINT permission on AndroidManifest under config/Android when you publish project.

Property

Ios

Android

Static

Since

1.1.13

Deprecated

since 4.3.1 Use Device.System#biometricsAvailable

biometricsAvailable: boolean

Returns true if the device supports the biometric feature and at least one the biometric is enrolled by user.

Property

Ios

Android

Static

Since

4.3.1

clipboard: null | string

clipboard can be used to set a text to the device's clipboard or get a text from it.

Property

Android

Ios

Static

Since

0.1

Deprecated

since 5.0.4 Use Device.System#setClipboard and Device.System#getClipboard

isEmulator: boolean

Determine if the current running platform is Smartface Emulator or published application

Property

Android

Ios

Static

Since

4.4.0

BiometryType: BiometryType

Device.System.BiometryType

Since

4.3.1

Ios

Android

The set of available biometric authentication types.

Methods

  • Checks if the provided finger print matches with the system's finger print. Will be false if TouchID not enabled for iOS and user not enrolled at least one fingerprint for Android or hardware not supported by both of iOS and Android. Requires Application.android.Permissions#USE_FINGERPRINT permission on AndroidManifest. iOS only propery is deprecated.

    Example

    System.validateFingerPrint({
    android: {
    title: "Title"
    },
    message : "Message",
    onSuccess : function(){
    console.log("Success");
    },
    onError : function(){
    console.log("Error");
    }
    });

    Method

    validateFingerPrint

    Static

    Ios

    Android

    Since

    1.1.13

    Deprecated

    since 4.3.1 Use Device.System#validateBiometric

    Parameters

    • params: { android: Partial<{ title: string }>; message: string; onSuccess: (() => void); onError: (() => void) }
      • android: Partial<{ title: string }>
      • message: string
      • onSuccess: (() => void)
          • (): void
          • Returns void

      • onError: (() => void)
          • (): void
          • Returns void

    Returns void

  • Shows the biometric prompt to the user. It will trigger onError callback if the biometric not enabled for iOS and user not enrolled at least one for Android or hardware not supported by both of iOS and Android.

    Example

    System.validateBiometric({
    android: {
    title: "Title",
    cancelButtonText: "Cancel",
    subTitle: "SubTitle",
    confirmationRequired: true
    },
    message : "Message",
    onSuccess : function(){
    console.log("Success");
    },
    onError : function(cancelled, error){
    console.log("Error");
    }
    });

    Method

    validateBiometric

    Static

    Ios

    Android

    Since

    4.3.1

    Parameters

    • params: { android: { title: string; cancelButtonText?: string; subTitle?: string; confirmationRequired?: boolean }; message: string; onSuccess: (() => void); onError: ((cancelled?: boolean, error?: string) => void) }
      • android: { title: string; cancelButtonText?: string; subTitle?: string; confirmationRequired?: boolean }
        • title: string
        • Optional cancelButtonText?: string
        • Optional subTitle?: string
        • Optional confirmationRequired?: boolean
      • message: string
      • onSuccess: (() => void)
          • (): void
          • Returns void

      • onError: ((cancelled?: boolean, error?: string) => void)
          • (cancelled?: boolean, error?: string): void
          • Parameters

            • Optional cancelled: boolean
            • Optional error: string

            Returns void

    Returns void

  • Vibrates the device for a while. iOS ignores given parameter.

    Method

    vibrate

    Android

    Ios

    Static

    Since

    0.1

    Parameters

    • params: { millisecond: number }
      • millisecond: number

    Returns void

  • Checks if an app is installed or not.

    Method

    isApplicationInstalled

    Android

    Ios

    Static

    Since

    0.1

    Parameters

    • packageName: string

      | schemaName

    Returns void

  • Set ClipboardData to the device clipboard.

    If clipboard contains any sensitive content; such as passwords or credit card information; you must set Device.System#ClipboardData.android.isSensitive to true for Android.

    Method

    setClipboard

    Android

    Ios

    Static

    Since

    5.0.4

    Parameters

    Returns void

  • Get ClipboardData from the device clipboard.

    Method

    getClipboard

    Android

    Ios

    Returns

    Static

    Since

    5.0.4

    Returns ClipboardData

Constructors

Generated using TypeDoc