# Share on WeChat Moments
From the base library 2.11.3 Start support
Support platform:Android、IOS: WeChat 8.0.24 and above
You can share the Mini Program page to WeChat Moments. It is suitable for sharing content pages, not for sharing pages with more interaction.
# Set Sharing Status
By default, the Mini Program page cannot be shared with WeChat Moments, and the developer must actively set the "Share to WeChat Moments." Pages are allowed to be shared on WeChat Moments, subject to two conditions:
- First, the page needs to be set to allow "send to a friend." Specific reference
Page.onShareAppMessage
Interface document - Satisfy the condition 1 Finally, the page needs to be set to allow "Share to WeChat Moments," and you can customize the title, share pictures, and so on. Specific reference
Page.onShareTimeline
Interface document
Pages that meet the above two criteria can be shared to WeChat Moments.
# Single page mode
When users open the shared Mini Program page in WeChat Moments, they do not really open the Mini Program, but enter a page of "Mini Program Single Page Mode," which has the following characteristics:
- "Single Page Mode," the top of the page fixed navigation bar, the title is displayed as the current page JSON The title of the configuration. There is a fixed action bar at the bottom, and clicking on the "go to Mini Program" in the action bar can open the current page of the Mini Program. The top navigation bar and the bottom action bar do not support custom styles.
- "Single Page Mode" runs the Mini Program page content by default, but because the page has a fixed top navigation bar and bottom action bar, it is likely to affect the layout of the Mini Program page. Therefore, developers should pay special attention to the page interaction that adapts to the "single page mode" to achieve a smooth and complete interactive experience.
- In "Single Page Mode," some components or interfaces have certain limitations, as detailed below[Limitations in Single Page Mode](#Limitations in Single Page Mode)chapter
# Page Fit
Can be judgedScene valueBe equal to 1154 To make page adaptations. In addition, in single-page mode, you can set the top navigation bar and the intersection of the page state, specific reference navigationBarFit Configuration.
Also note that in single page mode,wx.getSystemInfo Returned by the interface safeArea For the entire screen space.
# Limitations in Single Page Mode
The "single page mode" of the Mini Program is suitable for pure content display scenarios, and the interaction and interface capabilities that can be achieved are limited, so there are the following limitations:
- The page has no login state, and the login related interface, such as
wx.login
Are not availableCloud development resources require unsigned access to be turned on to use in single page mode, see[Unlogged mode](https://developers.weixin.qq.com/miniprogram/dev/wxcloud /basis/identityless.html)。 - Do not allow to jump to other pages, including any jump mini program page, jump to other mini programs, jump to WeChat native page
- Horizontal screen is not allowed
- If the page contains tabBar,tabBar Will not render, including custom tabBar
- Local storage and Mini Program normal mode not shared
For some components or interfaces that will generate interactions, when called after a click, it will bounce toast The message "Please go to the Mini Program to use the full service." For a good user experience, be aware of the interface capabilities for single-page mode, and do not heavily use disabled interfaces or components.
Disabled Ability List:
# Operating Instructions
The ability to share WeChat Moments is to meet the sharing demands of pure content scenarios, and abuse in marketing, induction and other behaviors will be cracked down.
- In the services provided by Mini programs, there shall be no abuse sharing violations. Forcing users to shareThe induced act of sharing immediate benefitsAs well as through the explicit or implicit style to achieve the purpose of inducing sharing behavior. See alsoWeChat Mini Program Platform Operation Specification
- In "Single Page Mode," users should not be induced or forced to click "Open Mini Program," and should be presented as complete as possible in "Single Page Mode."
# Note
- When the low version WeChat client is opened, it will enter an upgrade prompt page.
- Does not support the Mini Program page directly initiated sharing
- Custom page paths are not supported when sharing content
- existence web-view Component's page does not support initiating sharing
- Support to open the development version, experience version, unauthorized personnel to enter the page will prompt unauthorized