Since

0.1

A set of collection for application based properties and methods.

Hierarchy

Properties

byteReceived: number

The received bytes from the application.

Property

Android

Ios

Since

0.1

byteSent: number

The sent bytes from the application

Property

Android

Ios

Since

0.1

sliderDrawer: SliderDrawer

Gets/sets sliderDrawer of the Application.

Property

Default Value

null

Android

Ios

Since

3.2.0

keepScreenAwake: boolean

This property allows you to prevent the screen from going to sleep while your app is active.

Property

Android

Default Value

false

Ios

Since

4.3.1

exit: (() => void)

Type declaration

    • (): void
    • Exists the application.

      Method

      exit

      Android

      Ios

      Since

      0.1

      Returns void

restart: (() => void)

Type declaration

    • (): void
    • Restarts the application.

      Method

      restart

      Android

      Ios

      Since

      0.1

      Returns void

setRootController: ((controller: NavigationControllerImpl) => void)

Type declaration

    • (controller: NavigationControllerImpl): void
    • Set root controller of the application.

      Method

      setRootController

      Android

      Ios

      Since

      3.2.0

      Parameters

      • controller: NavigationControllerImpl

      Returns void

call: ((params: ApplicationCallParams) => void)

Type declaration

    • (params: ApplicationCallParams): void
    • Readonly

      Launches another application and passes data. For Android, you can open application chooser with isShowChooser parameter and set chooser dialog title with chooserTitle. If an app can open a given URL resource onSuccess callback will be triggered otherwise onFailure will be triggered.

      Example

      // Calling application's Google Play Store page. Will work only for iOS
      Application.call({
      uriScheme: "market://details",
      data: {
      'id': Application.android.packageName
      }
      });
      // Open caller app with phone number.
      Application.call({ uriScheme: "tel:+901234567890", data: {} });
      // Call another application with its own url schema.
      Application.call({
      uriScheme: "mySchema://",
      data: {
      key: encodeURIComponent("Smartace Encoded Data")
      },
      onSuccess: function() {
      alert("Application call completed")
      },
      onFailure: function() {
      alert("Application call failed")
      }
      });
      // Call another application with package name and activity name. Works only for Android.
      Application.call({ uriScheme: "io.smartface.SmartfaceDev|io.smartface.SmartfaceDev.A", data: {} });
      // Call Smartface Emulator with url schema.
      Application.call({ uriScheme: "smartface-emulator://", data : {} });
      // Open Youtube with Chooser for Android
      Application.call({
      uriScheme: "https://www.youtube.com/watch?v=VMLU9mfzHYI",
      data: {},
      onSuccess: function() {
      alert("Application call completed")
      },
      onFailure: function() {
      alert("Application call failed")
      },
      isShowChooser: true,
      chooserTitle: "Select an Application"
      });

      Method

      call

      Deprecated

      Use Linking.openURL instead

      Android

      Ios

      Since

      0.1

      Parameters

      • params: ApplicationCallParams

      Returns void

canOpenUrl: ((url: string) => boolean)

Type declaration

    • (url: string): boolean
    • Checks URL's scheme can be handled or not by some app that installed on the device.

      To pass this method, URL schemes must be declared into "Info.plist" file for iOS and AndroidManifest.xml file for Android.

      Example

      for Google Maps

      // (Info.plist entry)
      <key>LSApplicationQueriesSchemes</key>
      <array>
      <string>comgooglemaps</string>
      </array>

      // After entry add on, urlScheme can be check;
      import Application from '@smartface/native/application';
      const isAppAvaible = Application.canOpenUrl("comgooglemaps://");

      // (AndroidManifest.xml entry)
      <manifest ...>
      ...
      <queries>
      <intent>
      <action android:name="android.intent.action.VIEW" />
      <data android:scheme="geo"/>
      </intent>
      </queries>
      </manifest>

      import Application from '@smartface/native/application';
      const isAppAvaible = Application.canOpenUrl("geo://");

      Method

      canOpenUrl

      Returns

      Deprecated

      Use Linking.canOpenURL instead

      Ios

      Android

      Since

      4.3.6

      See

      https://developer.android.com/training/package-visibility

      Parameters

      • url: string

      Returns boolean

statusBar: StatusBarImpl

Gets status bar object. This property is readonly, you can not set status bar but you can change properties of status bar of application.

Property

Android

Ios

Since

3.2.0

LayoutDirection: typeof LayoutDirection

Static variable that determines direction of the layouts. It can be LTR or RTL

Android: { KeyboardMode: typeof KeyboardMode; NavigationBar: { style: NavigationBarStyle }; Permissions: typeof ApplicationAndroidPermissions }

Type declaration

  • KeyboardMode: typeof KeyboardMode

    Static Variable to change keyboard type for input fields.

  • NavigationBar: { style: NavigationBarStyle }

    This lets you determine the navigation bar of the phone(the bar which usually has native back button and app switch) Works for Android 8.0 and above. Some phones might not have this.

    • style: NavigationBarStyle

      Determines whether the navigation bar should be light theme or dark theme based.

  • Permissions: typeof ApplicationAndroidPermissions

    Application.Android.Permissions

    Since

    1.1.16

    Permission enum for Application. Permission managements should be developed OS specific in the applications. Application.android.Permissions deprecated since 1.1.16. Use Application.Android.Permissions instead.

setAppTheme: ((theme: string) => void)

Type declaration

    • (theme: string): void
    • Set the configure the native theme.

      Method

      setAppTheme

      Android

      Since

      4.0.2

      Parameters

      • theme: string

      Returns void

hideKeyboard: (() => void)

Type declaration

    • (): void
    • This function hides keyboard.

      Method

      hideKeyboard

      Android

      Ios

      Since

      3.0.1

      Returns void

currentReleaseChannel: string

The specified release channel within project.json.

Property

Android

Ios

Since

0.1

smartfaceAppName: string

The application name within project.json

Property

Android

Ios

Deprecated

Since

0.1

appName: string

The application name within project.json

Property

Android

Ios

Since

4.0.7

version: string

The application version within project.json

Property

Android

Ios

Since

0.1

isVoiceOverEnabled: Boolean

Indicates whether the voiceover is enabled. Voiceover is also called a screen reader on Android.

Property

Android

Ios

Since

4.3.6

_nativeObject: any

Events

onUnhandledError: ((error: UnhandledError) => void)

Type declaration

    • (error: UnhandledError): void
    • Triggered when unhandelled error occurs.

      Since

      1.2 onUnhandledError

      Android

      Ios

      Since

      1.2

      Example

      import Application from '@smartface/native/application';

      Application.on(Application.Events.UnhandledError, (error) => {
      console.info('onUnhandledError', error);
      });

      Parameters

      • error: UnhandledError

      Returns void

  • Triggered before exiting application.

    Since

    0.1 onExit

    Android

    Ios

    Deprecated

    Since

    0.1

    Example

    import Application from '@smartface/native/application';

    Application.on(Application.Events.Exit, () => {
    console.info('onExit');
    });

    Returns void

onReceivedNotification: ((data: ReceivedNotificationParams) => void)

Type declaration

    • (data: ReceivedNotificationParams): void
    • Triggered after a push (remote) notification recieved. This event will be fired only if application is active and running.

      onReceivedNotification

      Android

      Ios

      Deprecated

      Since

      0.1

      Example

      import Application from '@smartface/native/application';

      Application.on(Application.Events.ReceivedNotification, (params) => {
      console.info('onReceivedNotification', params);
      });

      Parameters

      Returns void

onApplicationCallReceived: ((e: ApplicationCallReceivedParams) => void)

Type declaration

    • (e: ApplicationCallReceivedParams): void
    • Triggered when application is called by another application. For Android, onApplicationCallReceived will be triggered when the application started from System Launcher. For this reason, if data does not contain key that you can handle, you should ignore this call.

      onApplicationCallReceived

      See

      Android

      Ios

      Deprecated

      Since

      1.1.13

      Example

      import Application from '@smartface/native/application';

      Application.on(Application.Events.ApplicationCallReceived, (params) => {
      console.info('onApplicationCallReceived', params);
      });

      Parameters

      • e: ApplicationCallReceivedParams

      Returns void

onAppShortcutReceived: ((e: { data: { [key: string]: any } }) => void)

Type declaration

    • (e: { data: { [key: string]: any } }): void
    • Triggered when application is opened by an app shortcut. App shortcuts is also named Home Screen Quick Actions in iOS.

      onAppShortcutReceived

      Android

      Ios

      Deprecated

      Since

      4.3.6

      See

      Example

      import Application from '@smartface/native/application';

      Application.on(Application.Events.appShortcutReceived, (params) => {
      console.info('onAppShortcutReceived', params);
      });

      Parameters

      • e: { data: { [key: string]: any } }
        • data: { [key: string]: any }

          Data comes from extras of app shortcut intent in Android or UserInfo of app shortcut in iOS.

          • [key: string]: any

      Returns void

onMaximize: (() => void)

Type declaration

    • (): void
    • Triggered after application bring to foreground state. In Android, it triggered even the user is leaving another activity(even the activities launched by your app). That means Permissions & derived from Dialog components are makes this callback to triggered.

      Since

      0.1 onMaximize

      Android

      Ios

      Deprecated

      Since

      0.1

      Example

      import Application from '@smartface/native/application';

      Application.on(Application.Events.Maximize, () => {
      console.info('onMaximize');
      });

      Returns void

onMinimize: (() => void)

Type declaration

    • (): void
    • Triggered after application bring to background state. Background state means that user is in another app or on the home screen. In Android, it triggered even the user is launching another activity(even the activities launched by your app). That means Permissions & derived from Dialog components are make this callback to triggered.

      Since

      0.1 onMinimize

      Android

      Ios

      Deprecated

      Since

      0.1

      Example

      import Application from '@smartface/native/application';

      Application.on(Application.Events.Minimize, () => {
      console.info('onMinimize');
      });

      Returns void

Methods

  • Parameters

    • eventName: "exit"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "maximize"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "minimize"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "unhandledError"
    • callback: ((e: UnhandledError) => void)
        • (e: UnhandledError): void
        • Parameters

          • e: UnhandledError

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "applicationCallReceived"
    • callback: ((e: ApplicationCallReceivedParams) => void)
        • (e: ApplicationCallReceivedParams): void
        • Parameters

          • e: ApplicationCallReceivedParams

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "appShortcutReceived"
    • callback: ((e: Record<string, any>) => void)
        • (e: Record<string, any>): void
        • Parameters

          • e: Record<string, any>

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "backButtonPressed"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "exit" | "maximize" | "minimize" | "receivedNotification" | "unhandledError" | "applicationCallReceived" | "appShortcutReceived" | "backButtonPressed" | "requestPermissionResult"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "exit"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "maximize"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "minimize"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    Returns void

  • Parameters

    • eventName: "unhandledError"
    • callback: ((e: UnhandledError) => void)
        • (e: UnhandledError): void
        • Parameters

          • e: UnhandledError

          Returns void

    Returns void

  • Parameters

    • eventName: "applicationCallReceived"
    • callback: ((e: ApplicationCallReceivedParams) => void)
        • (e: ApplicationCallReceivedParams): void
        • Parameters

          • e: ApplicationCallReceivedParams

          Returns void

    Returns void

  • Parameters

    • eventName: "appShortcutReceived"
    • callback: ((e: Record<string, any>) => void)
        • (e: Record<string, any>): void
        • Parameters

          • e: Record<string, any>

          Returns void

    Returns void

  • Parameters

    • eventName: "backButtonPressed"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "exit" | "maximize" | "minimize" | "receivedNotification" | "unhandledError" | "applicationCallReceived" | "appShortcutReceived" | "backButtonPressed" | "requestPermissionResult"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

  • Parameters

    • eventName: "exit"

    Returns void

  • Parameters

    • eventName: "maximize"

    Returns void

  • Parameters

    • eventName: "minimize"

    Returns void

  • Parameters

    Returns void

  • Parameters

    • eventName: "unhandledError"
    • e: UnhandledError

    Returns void

  • Parameters

    • eventName: "applicationCallReceived"
    • e: ApplicationCallReceivedParams

    Returns void

  • Parameters

    • eventName: "appShortcutReceived"
    • e: Record<string, any>

    Returns void

  • Parameters

    • eventName: "backButtonPressed"

    Returns void

  • Parameters

    • eventName: "exit" | "maximize" | "minimize" | "receivedNotification" | "unhandledError" | "applicationCallReceived" | "appShortcutReceived" | "backButtonPressed" | "requestPermissionResult"
    • Rest ...args: any[]

    Returns void

  • Parameters

    • eventName: "exit"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "maximize"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "minimize"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "unhandledError"
    • callback: ((e: UnhandledError) => void)
        • (e: UnhandledError): void
        • Parameters

          • e: UnhandledError

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "applicationCallReceived"
    • callback: ((e: ApplicationCallReceivedParams) => void)
        • (e: ApplicationCallReceivedParams): void
        • Parameters

          • e: ApplicationCallReceivedParams

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "appShortcutReceived"
    • callback: ((e: Record<string, any>) => void)
        • (e: Record<string, any>): void
        • Parameters

          • e: Record<string, any>

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "backButtonPressed"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "exit" | "maximize" | "minimize" | "receivedNotification" | "unhandledError" | "applicationCallReceived" | "appShortcutReceived" | "backButtonPressed" | "requestPermissionResult"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns (() => void)

      • (): void
      • Returns void

  • Parameters

    • eventName: "exit"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "maximize"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "minimize"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    Returns void

  • Parameters

    • eventName: "unhandledError"
    • callback: ((e: UnhandledError) => void)
        • (e: UnhandledError): void
        • Parameters

          • e: UnhandledError

          Returns void

    Returns void

  • Parameters

    • eventName: "applicationCallReceived"
    • callback: ((e: ApplicationCallReceivedParams) => void)
        • (e: ApplicationCallReceivedParams): void
        • Parameters

          • e: ApplicationCallReceivedParams

          Returns void

    Returns void

  • Parameters

    • eventName: "appShortcutReceived"
    • callback: ((e: Record<string, any>) => void)
        • (e: Record<string, any>): void
        • Parameters

          • e: Record<string, any>

          Returns void

    Returns void

  • Parameters

    • eventName: "backButtonPressed"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "exit" | "maximize" | "minimize" | "receivedNotification" | "unhandledError" | "applicationCallReceived" | "appShortcutReceived" | "backButtonPressed" | "requestPermissionResult"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

  • Parameters

    • eventName: "exit"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "maximize"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "minimize"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    Returns void

  • Parameters

    • eventName: "unhandledError"
    • callback: ((e: UnhandledError) => void)
        • (e: UnhandledError): void
        • Parameters

          • e: UnhandledError

          Returns void

    Returns void

  • Parameters

    • eventName: "applicationCallReceived"
    • callback: ((e: ApplicationCallReceivedParams) => void)
        • (e: ApplicationCallReceivedParams): void
        • Parameters

          • e: ApplicationCallReceivedParams

          Returns void

    Returns void

  • Parameters

    • eventName: "appShortcutReceived"
    • callback: ((e: Record<string, any>) => void)
        • (e: Record<string, any>): void
        • Parameters

          • e: Record<string, any>

          Returns void

    Returns void

  • Parameters

    • eventName: "backButtonPressed"
    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • Parameters

    • eventName: "exit" | "maximize" | "minimize" | "receivedNotification" | "unhandledError" | "applicationCallReceived" | "appShortcutReceived" | "backButtonPressed" | "requestPermissionResult"
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns void

  • Executed before everything. This should return nativeObject since it will be assinged directly to nativeObject.

    Parameters

    • Optional params: Partial<Record<string, any>>

    Returns any

  • Parameters

    • Optional params: Partial<Record<string, any>>

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

Accessors

  • get nativeObject(): any
  • Returns any

  • set nativeObject(value: any): void
  • Parameters

    • value: any

    Returns void

  • get ios(): TProps["ios"]
  • Returns TProps["ios"]

  • get android(): TProps["android"]
  • Returns TProps["android"]

Generated using TypeDoc