tencent cloud

Tencent Cloud Super App as a Service

Customizing the QR Code Scanning API

Download
Focus Mode
Font Size
Last updated: 2025-07-04 17:33:28
The mini program SDK provides a default scanning implementation (QR Code Scanning Extension SDK) and also offers APIs for users to customize scanning capabilities.
To customize scanning capability, override the enterQRCode method in BaseMiniAppProxyImpl class.
API description:
Parameter context: The context of the mini program process that initiates the scanning
Parameter onlyFromCamera: Whether to allow scanning only from the camera
Parameter AsyncResult: Callback for the scanning result
Return value: Returns true to indicate that custom scanning capabilities are being used, or false to indicate that the built-in scanning capabilities (which require integration of the scanning extension library) are being used.
/**
* Scan the QR code
*
* @param context - Context
* @param onlyFromCamera - Only allows scanning from camera
* @param result - Scanning result
* @return true if using custom scanning; false if using built-in scanning.
*/
@Override
public boolean enterQRCode(Context context, boolean onlyFromCamera, AsyncResult result);





Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback