Add a customized QR code binding
Add a customized QR code binding to let users scan a standard QR code with a target app and land directly on a specific page in your mini program. It works by creating a server-side link between a standard web URL encoded in the QR code and your mini program page.
Before you begin
Before you begin, ensure you meet the following requirements:
- Role: You must have either of the following roles:
- Workspace Owner or Master
- Admin for the target mini program
- Version status: The mini program must have a version in the Full Release status.
- Binding capacity: Ensure you have not reached the maximum number of bindings. If you have, deactivate released bindings that are no longer needed to free up capacity.
- URL requirements: Ensure the QR code URL uses the HTTPS, HTTP, or FTP protocol, and the domain has a valid Internet Content Provider (ICP) filing.
- Target app installation: To test the binding, install a target app where your mini program is fully released on your mobile device.
Procedure
To add a customized QR code binding, take the following steps:
Step 1: Navigate to the customized QR code page
- In your workspace, navigate to the mini program list page.
- Find and click the mini program for which you need to add a customized QR code binding.
- On the mini program details page, click QR Code > Customized QR Code.
Step 2: Create a binding
- To start creating a binding, choose either of the following options:
- To create a brand new binding: Click + Add QR Code.
- To duplicate an existing binding: Find the existing released binding in the list and click Duplicate in its Actions column.
- In the Add a Customized QR Code dialog, configure the following fields:
- URL Prefix: Enter the web URL or URL prefix encoded in the QR code. Based on the selected Matching Method:
- For Exact Matching: Enter the complete URL.
- For Fuzzy Matching: Enter the shared URL prefix used by multiple QR codes.
- Matching Method: Select how to match the scanned URL to the entered URL Prefix.
- Exact Matching: Match only the URL specified in URL Prefix.
- Fuzzy Matching: Match all URLs that start with the specified URL Prefix.
- Mini Program Page Path: Enter the path of the mini program page that opens when users scan a matching QR code with a target app.
- Review your information carefully.
- Click Add.
The binding is added to the customized QR code list with a Draft status.
Step 3: Test and activate the binding
- In the customized QR code list, find your draft binding and click View in its Actions column.
- In the dialog that appears, click Test to generate a test QR code.
- Test the binding based on your selected matching method:
- For exact matching:
- Scan the displayed QR code with the target app.
- Verify that the QR code opens the expected mini program page.
- For fuzzy matching:
- To test the base URL prefix: Directly scan the displayed QR code with the target app and verify the opened page.
- To test child URLs of your specified URL prefix:
- In the input field, enter the remaining path of the URL you need to test. Note that if your URL prefix does not end with a slash
/, add one at the beginning of your entry. Example:
- URL prefix:
https://www.example.com/product - Additional path:
/123 - Full test URL:
https://www.example.com/product/123
- Click Generate QR Code to update the URL and the QR code.
- Review the new URL, and then scan the new QR code with a target app to verify it opens the correct page.
- Repeat these steps to test other child URLs.
- Based on your test result, choose either of the following actions:
- If the binding works correctly, click Release to activate it.
- If the binding needs changes:
- Click Edit.
- Update the configuration fields as needed.
- Click Save and Test to return to the test dialog and verify your changes.
- Once verified, click Release to activate the binding.
A success message appears, and the binding status changes from Draft to Released. Users who scan a matching QR code with a target app are now directed to the specified mini program page.