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

The operating mechanism


May 18, 2021 WeChat Mini Program Development Document



The operating mechanism

  • The small program does not have the concept of a restart
  • When the small program enters the background, the client will maintain a period of operation, after a certain period of time (currently 5 minutes) will be actively destroyed by WeChat
  • The overhead program will not be actively destroyed by WeChat
  • Small programs are also destroyed when a system memory alert is received

Turn on the logic again

Base library 1.4.0 starts to support, and low versions need to be compatible

There are two types of scenarios in which a user is expected to open a small program:

A. Open Home: Scene values are 1001, 1019, 1022, 1023, 1038, 1056

B. Open a page specified by the small program: The scene value is anything other than A

When you open a small program again the logic is as follows:

The last scene The scene that is currently open Effect
A A Leave the original state
B A Empty the original page stack and open the home page (equivalent to executing wx.reLaunch to the home page)
A or B B Empty the original page stack and open the specified page (equivalent to executing wx.reLaunch to the specified page)