Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat app shares to Beta


May 18, 2021 WeChat Mini Program Development Document


Table of contents


Share with Friends (Beta)

Support starts with base library 2.11.3
This feature is beta and is currently only available on Android platforms

You can share the small program page to your circle of friends. For content-based page sharing, not for page sharing with more interaction.

Set the sharing status

By default, small program pages cannot be shared to a circle of friends, and developers need to proactively set "share to a circle of friends". The page allows to be shared with a circle of friends, subject to two criteria:

  1. First, the page needs to be set to allow Send to Friends. Refer specifically to the Page.onShareAppMessage interface documentation
  2. Once condition 1 is met, the page needs to set permission to "share to a circle of friends" while customizing titles, sharing diagrams, and so on. Refer specifically to the Page.onShareTimeline interface documentation

Pages that meet both of these criteria can be shared with a circle of friends.

Single-page mode

The user opens the shared small program page in the circle of friends, does not really open the small program, but enters a "small program single page mode" page, "single page mode" has the following characteristics:

  1. Under Single Page Mode, the navigation bar is pinned to the top of the page, and the title appears as the title of the current page JSON configuration. T he bottom is pinned to the action bar, and clicking Go to the small program in the action bar opens the current page of the small program. Custom styles are not supported in neither the top navigation bar and the bottom action bar.
  2. "Single page mode" The default is running the applet page content, but because the top navigation bar and the bottom operation bar are fixed, it is likely to affect the layout of the applet page.Therefore, developers should pay special attention to the "single-page mode" page interaction to achieve a smooth interactive experience.
  3. Under "single page mode", some components or interfaces have certain restrictions, see the restrictions in single-page mode below.

WeChat app shares to Beta

Page adaptation

The page adaptation can be performed by judging the method equal to 1154.In addition, in single page mode, the intersection of the top navigation bar and the page can be set, and the specific reference navigationBarFit Configuration.

It is also important to note that in single page mode, the SAFEAREA returned by the wx.getsysteminfo interface is the entire screen space.

Single page mode limit

The small program "single page mode" is suitable for pure content display scenarios, and the interaction and interface capability can be achieved, so there is a limit:

  1. The page is lolessly recorded, and the interface related to the login, such as wx.login is unavailable; cloud development resources need to open unregistered access can be used in single page mode, see Unregistered mode.
  2. Do not allow you to jump to other pages, including any hop minus page, hopping other applets, hopping WeChat original page
  3. Cross-screen use is not allowed
  4. If the page contains tabBar, tabBar does not render, including custom tabBar
  5. Local storage is not shared with the normal mode of a small program

For some components or interfaces that generate interaction, when called after clicking, the toast prompts "Go to the small program to use the full service." For a good user experience, be aware of the interface capabilities that are appropriate for single-page mode, and do not heavily use disabled interfaces or components.

Disable the list of capabilities:

Classification Function points
Component button open-type 、 camera 、 editor 、 form 、 functional-page-navigator 、 live-pusher 、 navigator 、 navigation-bar 、 official-account 、 open-data 、 web-view
Routing wx.redirectTo 、 wx.reLaunch 、 wx.navigateTo 、 wx.switchTab 、 wx.navigateBack
Interface Navigation bar, Tab Bar
Internet mDNS, UDP communication
The data cache Periodic updates
Media VoIP 、 wx.chooseMedia 、 wx.chooseImage 、 wx.saveImageToPhotosAlbum 、 wx.chooseVideo 、 wx.saveVideoToPhotosAlbum 、 wx.getVideoInfo 、 wx.compressVideo
Position wx.openLocation 、 wx.chooseLocation 、 wx.startLocationUpdateBackground 、 wx.startLocationUpdate
Forward wx.getShareInfo 、 wx.showShareMenu 、 wx.hideShareMenu 、 wx.updateShareMenu
File wx.openDocument
Open interface Login, small program jump, user information, payment, authorization, settings, shipping address, voucher, invoice, biometric, WeChat movement, WeChat red envelope
Equipment Bluetooth, iBeacon, Wi-Fi, NFC, Contacts, Clipboard, Phone, Broom
Advertising ad 、 wx.createRewardedVideoAd 、 wx.createInterstitialAd

Operational know-how

Sharing the ability of the circle of friends is to meet the sharing demands of pure content scenes, abuse in marketing, induction and other behavior will be combated.

  1. There must be no abuse of sharing violations in the services provided by the program. S uch as forcing users to share behavior, sharing induced behavior that immediately benefits, and inducing sharing purposes through express or implied patterns. See WeChat Small Program Platform Operating Practices for details
  2. In Single-page mode, users should not be induced or forced to click "Open Small Programs" and should present as complete content as possible in Single-page mode

Tips:

  1. When a low-version WeChat client opens, it goes to an upgrade prompt page
  2. Direct sharing within the small program page is not supported
  3. Custom page paths are not supported when customizing shared content
  4. Pages with web-view components do not support initiating sharing
  5. Support to open the development version, experience version, no permissions when people enter the page will be prompted without permission