Guide for Integrating Invitation Posters in Mini-Program Embedded SaaS Viewing Pages
1. Applicable Scenarios
This document is applicable when the integrating party embeds a Polyv SaaS viewing page into a WeChat Mini-Program via the <web-view> method, and wishes to use invitation posters within the viewing page for sharing and source tracking.
Typical requirements include:
- Viewers watch the Polyv SaaS live streaming page within the integrating party's Mini-Program.
- When a sharing viewer clicks to share, an invitation poster with a Mini-Program code can be generated.
- After scanning the Mini-Program code on the poster, the visitor enters the integrating party's Mini-Program page.
- The integrating party wants to identify the sharing source via Mini-Program code parameters, such as channel, invitation poster, and sharer.
Note: The Mini-Program code must be generated by the integrating party's Mini-Program server. Polyv cannot use the integrating party's Mini-Program appid and secret to generate the Mini-Program code on its behalf.
2. Solution 1: SaaS Outputs Invitation Poster, Integrating Party Provides Mini-Program Code API
2.1 Implementation Method
In this approach, the invitation poster page is output by the Polyv SaaS viewing page, and the integrating party only needs to provide an API for obtaining the Mini-Program code.
Implementation logic:
- The integrating party configures a "Get Mini-Program Code API" in the Polyv backend.
- The sharing viewer clicks to share or generate an invitation poster on the SaaS viewing page.
- Polyv calls the API configured by the integrating party.
- The integrating party's server generates a parameterized Mini-Program code based on the parameters.
- The integrating party's API returns the image URL of the Mini-Program code.
- Polyv renders this Mini-Program code onto the SaaS invitation poster.
Polyv is responsible for:
- Outputting the native SaaS invitation poster page.
- Calling the Mini-Program code API configured by the integrating party.
- Displaying the Mini-Program code image returned by the integrating party on the invitation poster.
The integrating party is responsible for:
- Preparing the WeChat Mini-Program code generation capability.
- Providing the API for obtaining the Mini-Program code.
- Generating the corresponding Mini-Program code based on the parameters passed by Polyv.
- Ensuring that scanning the code directs the visitor to the specified page of the integrating party's Mini-Program.
Advantages:
- The integrating party does not need to develop the invitation poster UI separately.
- The invitation poster experience remains consistent with the SaaS viewing page.
- The integrating party's development scope is focused on the Mini-Program code API.
Notes:
- The logic for generating the Mini-Program code is still handled by the integrating party's server.
- The integrating party must ensure the API is stable and available.
- The Mini-Program code parameters must be consistent with the parsing logic of the integrating party's Mini-Program landing page.
2.2 Integration Process
graph TD
A["分享发起观众点击分享"] --> B["SaaS 观看页生成邀请海报"]
B --> C["保利威调用接入方小程序码接口"]
C --> D["接入方服务端生成小程序码"]
D --> E["返回小程序码图片地址"]
E --> F["SaaS 邀请海报展示小程序码"]
F --> G["扫码访问者扫码进入接入方小程序"]
- The integrating party confirms the landing page after scanning the Mini-Program code.
- The integrating party's server integrates the WeChat Mini-Program code generation capability.
- The integrating party develops the "Get Mini-Program Code API," which returns the image URL of the Mini-Program code.
- The integrating party configures this API URL in the Polyv backend.
- The sharing viewer clicks to share and generates an invitation poster on the SaaS viewing page.
- Polyv calls the integrating party's API to obtain the Mini-Program code.
- The integrating party's API generates the Mini-Program code based on the parameters and returns the image URL.
- Polyv displays the Mini-Program code on the invitation poster.
- The scanning visitor scans the code and enters the integrating party's Mini-Program.
The integrating party needs to complete:
- Prepare the Mini-Program
appidandsecret. - Prepare the server-side capability to generate Mini-Program codes.
- Provide a Mini-Program code API that can be called by Polyv.
- Define the tracking parameters to be carried in the Mini-Program code.
- Parse the parameters on the Mini-Program landing page and handle subsequent business logic.
3. Solution 2: Integrating Party Develops the Sharing Page Natively in the Mini-Program
3.1 Implementation Method
In this approach, the integrating party implements the share button, share popup, invitation poster, and Mini-Program code display natively outside the Mini-Program WebView.
Implementation logic:
- The SaaS viewing page runs as an H5 page within the Mini-Program
<web-view>. - The integrating party overlays native Mini-Program components outside the WebView.
- The sharing viewer clicks the share entry developed by the integrating party.
- The integrating party's Mini-Program calls its server to generate the Mini-Program code.
- The integrating party's Mini-Program displays the invitation poster or share popup.
Polyv is responsible for:
- Providing the SaaS viewing page content.
- Not participating in the UI or Mini-Program code generation process of the integrating party's native sharing page.
The integrating party is responsible for:
- Designing and developing the native share entry in the Mini-Program.
- Designing and developing the invitation poster UI.
- Calling its server to generate the Mini-Program code.
- Displaying the poster, saving the poster, or triggering the Mini-Program's sharing capability.
- Maintaining the business logic and tracking logic within the sharing chain.
Advantages:
- The UI and interaction of the sharing page are fully controlled by the integrating party.
- Can be combined with the integrating party's own business capabilities, such as membership, coupons, events, and distribution.
- Decoupled from the SaaS invitation poster display logic.
Notes:
- The integrating party needs to maintain the complete sharing system independently.
- Higher development and testing costs.
- Whether the sharing experience is consistent with the SaaS viewing page is controlled by the integrating party.
3.2 Integration Process
graph TD
A["分享发起观众点击接入方原生分享入口"] --> B["接入方小程序请求服务端生成小程序码"]
B --> C["接入方服务端返回小程序码"]
C --> D["接入方小程序展示自定义邀请海报"]
D --> E["扫码访问者扫码进入接入方小程序"]
- The integrating party opens the SaaS viewing page in the Mini-Program via
<web-view>. - The integrating party develops a native share entry outside the WebView.
- The sharing viewer clicks the integrating party's native share entry.
- The integrating party's Mini-Program calls its server to generate the Mini-Program code.
- The integrating party's Mini-Program displays a custom invitation poster or share popup.
- The scanning visitor scans the code and enters the integrating party's Mini-Program.
- The integrating party's Mini-Program parses the parameters and completes tracking.
The integrating party needs to complete:
- Design the native share entry and sharing page in the Mini-Program.
- Develop the capability to generate or display invitation posters.
- Prepare the server-side capability to generate Mini-Program codes.
- Design the scan landing page and parameter parsing logic.
- Maintain the sharing, saving, scan return, and tracking chain.
4. Solution Comparison
| Comparison Item | SaaS Outputs Invitation Poster, Integrating Party Provides Mini-Program Code API | Integrating Party Develops Sharing Page Natively in Mini-Program |
|---|---|---|
| Sharing Page UI Output | Polyv | Integrating Party |
| Mini-Program Code Generation | Integrating Party | Integrating Party |
| Mini-Program Code Display Location | SaaS Invitation Poster | Integrating Party's Native Mini-Program Sharing Page |
| Does Integrating Party Need to Develop Sharing UI? | No | Yes |
| Does Integrating Party Need to Provide API to Polyv? | Yes | No |
| Customization Capability | Limited by SaaS invitation poster capabilities | Fully controlled by integrating party |
| Development Cost | Lower | Higher |
| Suitable For | Integrating party wants to reuse the SaaS invitation poster, only needs Mini-Program code and tracking | Integrating party wants deep customization of the sharing page and to incorporate more of its own business logic |
