# Support Weixin Mini Program Open
Support from the base library 2.14.3
Supported platform: Android
Home version: webview Open Weixin Mini Program Need to upgrade to WeChat 7.0.22 and above, the file and video opening Mini Program needs to be upgraded to WeChat 8.0.0 and above, and the picture opening Mini Program need to be upgradered to WeChat 8.0.1 and above
Support type: Weixin Mini Program only, MiniGame not supported
# Features Description
WeChat The opening of content (files, pictures, videos, and webview) in chat has increased the opening of the portal using Weixin Mini Program.Users can process files, pictures, videos and webview in the chat through Mini programs. For example, use Mini programs to store files to the network disk, add filters to pictures, perform video frequency editing or save webview to notes. At present, only images without QR codes are supported to be opened directly through the Mini Program.
When a user opens a material in a WeChat chat, if Weixin Mini Program is configured to support the opening and approval of that type of material, and the user has previously used the Mini Program, an entry opens using the Mini Program appears when the user opens that type of footage.
In the PC base library larger than 3.7.6 environment, the user can drag the file to trigger Weixin Mini Program open.When the file that fits the rules is dragged in, the frame side will relaunch the Mini Program. When you drag a file that does not conform to the rules, the framework side prompts the user that the file is not supported.
# Instructions
Developers need to declare the file types that are supported to open in Weixin Mini Program global configuration (apagejson) and can declare only one way to handle a file type.
{
"supportedMaterials": [
{
"materialType": "text/html",
"name": "用${nickname}打开",
"desc": "描述",
"path": "pages/index/"
},
{
"materialType": "video/*",
"name": "用${nickname}播放",
"desc": "描述",
"path": "pages/index/"
},
{
"materialType": "video/mp4",
"name": "用${nickname}播放",
"desc": "描述",
"path": "pages/index/"
}
]
}
| attribute | type | Required to fill in | describe |
|---|---|---|---|
| materialType | String | yes | Support document typeMimeType, audio, video Support generic mode for secondary configurations, such as:video /*。When both a universal mode configuration and a precise type configuration are present, the precise type of configuration is given priority (e.g. [[]]video/*Andvideo / mp4, thevideo / mp4 ( configuration is preferred. |
| name | String | yes | The title of the developer configuration, which will be displayed on the material page, must include${nickname}in the configuration,When the package is compiled, it is automatically replaced with the Weixin Mini Program name, and the abbreviation is preferred if the abbreviation is declared.Except for${nickname}the remaining words shall not exceed 6. |
| desc | String | yes | Description of the use. The description will be displayed on the recommended list and is limited to 22 words. |
| path | String | yes | Jump to page when Weixin Mini Program is opened in this scenario |
Latest client version SupportedMimeTypeType:
| MimeType | File suffixes | Introductions |
|---|---|---|
| video/* | Video file | |
| audio/* | Audio Class Files | |
| image/* | Pictures file | |
| text/html | webview | |
| text/plain | .txt | |
| application/* | Common File Configuration | |
| application/pdf | ||
| application/msword | .doc | |
| application/vnd.openxmlformats-officedocument.wordprocessingml.document | .docx | |
| application/vnd.ms-word.document.macroEnabled.12 | .docm | |
| application/vnd.ms-excel | .xls | |
| application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | .xlsx | |
| application/vnd.ms-excel.sheet.macroEnabled.12 | .xlsm | |
| application/vnd.ms-powerpoint | .ppt | |
| application/vnd.openxmlformats-officedocument.presentationml.presentation | .pptx | |
| application/zip | .zip | |
| application/vnd.rar | .rar | |
| application/x-7z-compressed | .7z | |
| application/x-photoshop | .psd | |
| application/acad | .dwg | |
| application/x-cdr | .cdr | |
| application/dxf | .dxf | |
| application/step | .stp | |
| application/rtf | .rtf | |
| application/postscript | .ai |
# Weixin Mini Program Startup parameters
Weixin Mini Program Start parameter The scene value is1173,In this scenario, there is an arrayforwardMaterialsat the same level as the startup parameter and query,Represents the forwarded file information. Each object in the array contains an attribute{type, name, path, size}stands for the file type, file name, file path or url, and file size respectively
# release
Weixin Mini Program When reviewing, it will review whether the declaration ofsupportedMaterialsis compliant. The Mini Program will appear only after the corresponding file type opens the entrance to the Mini Program.
Features implemented by Weixin Mini Program will not be approved if they are of low value, including but not limited to:
- The function after opening Weixin Mini Program has nothing to do with the corresponding material: it just opens its own Mini Program through this entrance, and does not do any processing of the material.
- Turning on Weixin Mini Program to process material is too simple: simple functions such as simply playing a video or simply viewing a.docx file, for example, that can be achieved through WeChat chat.
Please developers combine their own Weixin Mini Program features and user needs to adapt.
# debugging
# The Experience Edition
Weixin Mini Program supports individual configurationsupportedMaterials, The official version of the Mini Program configuration is independent of each other, and the corresponding list of entry Mini Programs mentioned above also displays the experience Mini Programs separately.
# Developer Tools
Developers can debug this feature in custom compilation mode with the scene value1173.