setFlashlight
Note
Please contact Zalopay Team to be granted permission to use this functionality.Supported Version
zpa
Started support in Zalopay App from version 8.26.0Description
Turn on/off phone flash
Parameters
Param | Data type | Required | Description |
---|---|---|---|
on | boolean | Yes | true : turn on flashlight, false : turn off flashlight |
Return Value
N/A
Error Code
Error Code | Description |
---|---|
011101 | Flashlight not supported |
011102 | Cannot turn on/off the flashlight |
Sample Code and Sample Return Data
Sample Request:
window.zlpSdk.Device
.setFlashlight({ on: true })
.then((response) => console.log(response))
.catch((error) => console.error(error.errorCode));
Sample Response:
{ data: {}, status: "success" }