Fxiaoke Developer Manual Fxiaoke Developer Manual
  • APL Development Manual
  • PWC Development Manual
  • OpenAPI Documentation
  • Quick Start
  • API Authorization
  • API Basics
  • OpenAPI
  • SSO Integration
  • Client Development
  • FAQ
  • OpenApi Version V1 (opens new window)
  • 简体中文
  • English
  • Quick Start
  • API Authorization
  • API Basics
  • OpenAPI
  • SSO Integration
  • Client Development
  • FAQ
  • OpenApi Version V1 (opens new window)
  • 简体中文
  • English
  • Quick Start

  • API Authorization

  • API Basics

  • OpenAPI

  • SSO Integration

  • Client Development

    • Integration Guide

    • JavaScript API

      • Container
      • Device
        • Launcher
        • Webview
        • Modal
        • Fxiaoke
        • Media
        • Utilities
      • UI Components

    • FAQ

    Table of Contents

    Device

    # Device

    API Name Description
    device.authenticateUser Authenticates current user via fingerprint or Fxiaoke password
    device.getAP Gets access point identifier
    device.getNetworkType Gets current network type: WiFi, 2/3/4G
    device.getUUID Gets device unique identifier
    device.scan Invokes QR code scanning
    device.vibrate Triggers device vibration

    # Authenticate Current User

    This API displays an authentication page where users must verify their fingerprint (supports Touch-ID when enabled) or enter their Fxiaoke password to pass authentication.

    Code Example:

    FSOpen.device.authenticateUser({
        appName: 'Salary Assistant',
        onSuccess: function(resp){
            alert('Authentication succeeded');
        },
        onFail: function(error){
            if (error.errorCode === 40050) {
                alert('Authentication canceled');
                return;
            }
            alert('Operation failed, error code: ' + error.errorCode);
        }
    });
    

    Method: FSOpen.device.authenticateUser
    JS Version: 2.0.0
    Client Support: 5.4.0+

    Parameters:

    Parameter Type Required Description
    appName String Yes Current application name

    # Get Access Point Identifier

    Code Example:

    FSOpen.device.getAP({
        onSuccess: function(resp) {
            // ssid: 'FSDevLan'
            // macAddress: '3c:12:aa:09'
            alert('ssid = ' + resp.ssid + '\n' + 'macAddress = ' + resp.macAddress);
        }
    });
    

    Method: FSOpen.device.getAP
    JS Version: 2.0.0
    Client Support: 5.4.0+

    Success Callback Returns:

    Parameter Type Description
    ssid String Hotspot SSID
    macAddress String Hotspot MAC address

    # Get Network Type

    Code Example:

    FSOpen.device.getNetworkType({
        onSuccess: function(resp) {
            // network: '3g'
            alert('network = ' + resp.network);
        }
    });
    

    Method: FSOpen.device.getNetworkType
    JS Version: 2.0.0
    Client Support: 5.4.0+

    Success Callback Returns:

    Parameter Type Description
    network String Network type: Possible values: 2g, 3g, 4g, wifi, unknown, none (offline)

    # Get Device Unique Identifier

    Code Example:

    FSOpen.device.getUUID({
        onSuccess: function(resp) {
            // uuid: 'FD71A168-1CAD-4EF1-BECC-52997124207A'
            alert('uuid = ' + resp.uuid);
        }
    });
    

    Method: FSOpen.device.getUUID
    JS Version: 2.0.0
    Client Support: 5.4.0+

    Success Callback Returns:

    Parameter Type Description
    uuid String Device unique identifier

    # Invoke QR Code Scanning

    Code Example:

    FSOpen.device.scan({
        onSuccess: function(resp) {
            // text: 'https://www.fxiaoke.com/'
            alert('Scan result: ' + resp.text);
        }
    });
    

    Method: FSOpen.device.scan
    JS Version: 2.0.0
    Client Support: 5.4.0+

    Success Callback Returns:

    Parameter Type Description
    text String QR code content

    # Device Vibration

    Code Example:

    FSOpen.device.vibrate({
        duration: 3000
    });
    

    Method: FSOpen.device.vibrate
    JS Version: 2.0.0
    Client Support: 5.4.0+

    Parameters:

    Parameter Type Required Description
    duration Number No Vibration duration (Android only). Unit: milliseconds. Default: 3000ms (3s)
    Container
    Launcher

    ← Container Launcher →

    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式