# Chat material support Mini Program open
From the base library 2.14.3 Start support
Support platform:Android
Client version:Webview to open Mini Program need to upgrade to WeChat 7.0.22 and above, file and video to open Mini Program need to upgrade to WeChat 8.0.0 And above version, picture open mini program need to upgrade to WeChat 8.0.1 and above version
Type of support:Only Mini programs, small games are not supported
# Function introduction
WeChat chat materials (files, pictures, videos and webview) to open the way to increase the use of Mini programs to open the entrance. 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 directly through Mini programs.
# Instructions
Developers need to beMini Program Global Configuration(app.json)Supports open file types and can only be declared one way to handle a file type.
{
"supportedMaterials": [
{
"materialType": "text/html",
"name": "Open with ${nickname},"
"desc": "Description,"
"path": "pages/index/"
},
{
"materialType": " video/*",
"name": "Play with ${nickname},"
"desc": "Description,"
"path": "pages/index/"
},
{
"materialType": " video/mp4",
"name": "Play with ${nickname},"
"desc": "Description,"
"path": "pages/index/"
}
]
}
attribute | type | Required | describe |
---|---|---|---|
materialType | String | yes | Support for file typesMimeType , Audio, Video Support Two Level Configuration Mode, such as: video/* When wildcard mode configuration and exact type configuration exist together, the exact type configuration is preferred(for examplevideo/* andvideo/mp4 Exist at the same time, will give priority to the use ofvideo/mp4 Configuration of the)。 |
Name | String | yes | The title of the developer configuration, which will be displayed on the material page, must be included in the configuration${nickname} , The package is automatically replaced with the Mini Program name when compiled, and if the abbreviation is declared, it will be used firstAbbreviationRemove the${nickname} The remaining words must not exceed 6. |
desc | String | yes | A description of the use, which is displayed in the recommended list, is limited to no more than 22 words. |
path | String | yes | Jump to page when you open the Mini Program in this scenario |
Latest client versionSupportedMimeType
Type:
MimeType | File suffix | Introductions |
---|---|---|
video/* | Video Class Files | |
audio/* | Audio Class Files | |
image/* | Image class 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 |
# Mini Program start parameter
Mini Program start parameterThe scene value is1173
, in this scenario, there is an array at the same level as the startup parameter and queryforwardMaterials
, represents the forwarded file information. Each object in the array contains an attribute{type,name,path,size}
They represent document type, file name, file path or url, file size
# release
The Mini Program will review the statement at the arraignmentsupportedMaterials
Whether the Mini Program is compliant or not, the Mini Program will appear after the corresponding file type opens the entrance.
If the function value of the Mini Program is low, it will not be approved, including but not limited to the following circumstances:
- The function after opening the 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 to the material.
- The way to handle the material after opening the Mini Program is too simple: just play a video or just view a.docx file, such as simple functions that can be achieved through WeChat chat.
Please developers with their own Mini Program functions and user needs to adapt.
# debugging
# Experience version
Experience Mini Program support separate configurationsupportedMaterials
, and the official version of the Mini Program configuration is independent of each other, and the corresponding entry Mini Program list will also separately show the experience version of the Mini Program.
# Developer Tools
Developers can pass scene values in custom compilation mode1173
Debug the function.