# wx.onAppShow(function callback)

Start from base library version 2.1.2. Please remaining backward compatible.

with Promise style call: Not supported

Mini Program plugin: Not supported

Listen to the Mini Program cut foreground events. This event is related to App.onShow The callback parameters of.

# parameter

# function callback

Callback Function for Mini Programs to Cut Foreground Events

# parameter

# Object res
attribute type Introductions
path string Mini Programs cut the foreground path (Code packet path)
scene number Mini Program cut the front deskScene value
query Object Mini Program cut the front desk query parameter
shareTicket string Share Ticket, seeGet more forwarding information
referrerInfo Object Source information. From another little program, Official Account message template or App Returns when entering the Mini Program. Otherwise return {}。(See below for attention)
forwardMaterials Array.&ltObject&gt An array of open file information that is only carried when opened from the chat material scene (scene 1173)

referrerInfo Structure

attribute type Introductions
appId string Source Mini Program, Official Account message template or App of appId
extraData Object Source Mini Program passed data, scene = 1037 or 1038 support

forwardMaterials Structure

attribute type Introductions
type string File mimetype type type
name string file name
path string File path (url if webview)
size number file size

# Return valid referrerInfo The scene

Scene value scene AppId meaning
1020 Official Account message template profile List of page - related Mini Programs source Official Account message template
1035 Official Account message template Custom menu source Official Account message template
1036 App Share Message Card Source App
1037 Mini Program open Mini Program Source Mini Program
1038 Back from another Mini Program Source Mini Program
1043 Official Account message template Template message source Official Account message template

# Be careful

Partial Version NoreferrerInfoWill return when undefinedRecommended for use options.referrerInfo && options.referrerInfo.appId To judge.