Basic Utility
These basic utility APIs provide core functionality for networking and checking compatibility within the Mini Game environment.
API namespace is compatible with tt, wx, and TTMinis.game. For example, TTMinis.game.login is equivalent to tt.login and wx.login.
TTMinis.game.canIUse(schema)
Hides the keyboard.
Note: Supported starting from SDK version 0.6.0. Lower versions must be adjusted for compatibility.
Checks whether the API, callback, parameter, or option is available in the current version.
Parameters
Field | Type | Description | Required |
|
| The schema string using the | Yes |
Returns
Field | Type | Description |
result |
| Whether the feature is available in the current version |
Example
// Object property or method
TTMinis.game.canIUse('env.USER_DATA_PATH')
// TTMinis.game interface parameter, callback, or return value
TTMinis.game.canIUse('openBluetoothAdapter')
TTMinis.game.canIUse('getSystemInfoSync.return.safeArea.left')
TTMinis.game.canIUse('getSystemInfo.success.screenWidth')
TTMinis.game.canIUse('showToast.object.image')
TTMinis.game.canIUse('onCompassChange.callback.direction')
TTMinis.game.canIUse('request.object.method.GET')TTMinis.game.env
Provides environment variables for the mini game.
Properties
Field | Type | Description |
|
| The user directory path in the file system (local path) |