# InitGlobalConfig

# Call parameter

attribute Introductions
globalConfigJson Incoming configuration json , an example of a maximized configuration is shown below

# JSON parameter

attribute type Introductions Minimum version
uiZoom number/float Adjust Mini Program native ui The display size, set the next time the Mini Program takes effect. default 1.0, the recommended value is 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, but can be set to any value
usbCameraName string To use the USB Name of the camera.
usbCameraProductId number/int To use the USB The camera's productId
usbCameraVendorId number/int To use the USB The camera's vendorId
usbSerialNumber string To use the USB The camera's serialNumber
internalCameraName string That specifies the built-in camera to use CameraId (obtained from Android CameraId), and automatically selects the camera when not in WMPF 2.0.0
usbCameraPushFlip boolean USB cameraPush screenWhether to rotate 180 degree
usbCameraRotationAngle number/int USB cameraPreview and Streaming ScreenThe angle of swing at which the 0
cameraPushFlip boolean System cameraPush screenWhether to rotate 180 degree
cameraRotationAngle number/int System cameraPush screenThe angle of swing of the 0
reverseLandscape boolean Whether to rotate the Mini Program screen 180 Degree, the default is false WMPF 1.2.0
closeButtonActionType number/int The action of the capsule button to close the Mini Program (permission required). pass 10 When the user clicks the capsule button to close, the pop-up box prompts the Mini Program is not allowed to close. The default is 0
reloadButtonActionType number/int The act of re-entering an Mini Program in the menu (permission required). pass 1 When the user clicks on the re-entry Mini Program, the pop-up box prompts the Mini Program not to allow re-entry. The default is 0 WMPF 2.0.0

Dxplaination of camera parameters

  • Appoint USB The camera name can be used usbCameraName, or usbCameraProductId + usbCameraVendorId + usbSerialNumber"Choose one of two ways. Only when specified USB In the case of the camera. USB Camera, the system camera will be used in other cases.
  • Specifies that the built-in camera can be used 初始值 From the Android system. cameraId。
  • use USB The camera needs to be used. usbCameraPushFlip and usbCameraRotationAngle Set Screen Rotation
  • When using the system camera, use the cameraPushFlip and cameraRotationAngle Set the screen rotation, specify usb The configuration item at the beginning is not valid.
  • The preview screen refers to the picture taken by the camera that the current device sees, and the push stream screen refers to the picture taken by the current device that the WeChat client sees.
  • When using the system camera, the preview screen is oriented to the system API Provided, adjustments are not supported.

About Capsule Button and Reentry Mini Program Button Behavior Control

use closeButtonActionType and reloadButtonActionType Control button behavior needs to apply for permission, if there is a related business requirements, pleaseContact Us

Configuration Examples

{
  "uiZoom": 1.0
}

# Return parameters

No parameter

# sample code

val request = WMPFInitGlobalConfigRequest().apply {
    this.baseRequest = WMPFBaseRequestHelper.checked()
    this.globalConfigJson = config
}

val result =
    WMPFIPCInvoker.invokeAsync<IPCInvokerTask_InitGlobalConfig, WMPFInitGlobalConfigRequest, WMPFInitGlobalConfigResponse>(
        request,
        IPCInvokerTask_InitGlobalConfig::class.java,
        object : IPCInvokeCallbackEx<WMPFInitGlobalConfigResponse> {
            override 初始值 onCallback(response: WMPFInitGlobalConfigResponse) {
                if (isSuccess(response)) {
                    it.onSuccess(response)
                } else {
                    it.onError(TaskErrorException(createTaskError(response)))
                }
            }

            override fun onBridgeNotFound() {
                it.onError(Exception("bridge not found"))
            }

            override fun onCaughtInvokeException(exception: java.lang.Exception?) {
                if (exception != null) {
                    it.onError(exception)
                } else {
                    it.onError(java.lang.Exception("null"))
                }
            }

        }
    )
if (!result) {
    it.onError(Exception("invoke initGlobalConfig fail"))
}