Start from base library version 1.1.0. Please remaining backward compatible.
The scene value describes a path in which a user enters a Mini Program. For the definition of the scene value, refer to Scene Value List.
Due to restriction of the Android system, currently, the value for the scene where the user taps the Home button to exit the Mini Program and return to the home page and then enters the Mini Program from the home page cannot be obtained. In this case, the previous scene value is retained.
Obtaining the scene value
Developers can obtain the scene value in the following manners:
- For Mini Programs, you can obtain the scene value via
Appor via wx.getLaunchOptionsSync.
- For Mini Games, you can obtain the scene value via wx.getLaunchOptionsSync and wx.onShow.
Scenes where source information is returned
In some scenes, the returned scene values come with the appId of the source app, Official Account, or Mini Program. For details, refer to the reference documents of the corresponding API.
|Scene Value||Scene||Meaning of appId|
|1020||Related Mini Program list in the profile page of an Official Account||Source Official Account|
|1035||Custom menu of an Official Account||Source Official Account|
|1036||Message card shared from an app||Source app|
|1037||Mini Program opened from a Mini Program||Source Mini Program|
|1038||Returned from another Mini Program||Source Mini Program|
|1043||Template message of an Official Account||Source Official Account|