Mini App Document Mini App Document
  • Start
  • Configuration
  • Framework
  • Custom Components
  • Basic ability
  • Configuration
  • Interface
  • FXML syntax
  • FXS syntax
API
Components
IDE
  • Developer
  • Operator
  • Start
  • Configuration
  • Framework
  • Custom Components
  • Basic ability
  • Configuration
  • Interface
  • FXML syntax
  • FXS syntax
API
Components
IDE
  • Developer
  • Operator
  • API overview
  • Basics
  • Routing
  • Jump
  • Forwarding
  • Interface
  • Network
  • Data caching
  • Media
  • Map
  • Location
  • File
  • Device
  • Canvas
  • FXML
  • Customize the menu
    • 1. More menu function descriptions of Mini Apps
    • 2. More menu examples for MiniApps
      • 2.1 Share ID
      • 2.2 Share configuration
  • Other
  • API
2022-08-09
Directory

Customize the menu

# 1. More menu function descriptions of Mini Apps

In order to support different business needs within the app and support different types of sharing, the current SDK supports configuring more menus, which can be divided into onMiniProgram and common types according to type (both configured in the management background)

  • common: This type does not require additional processing from the MiniApp
  • onMiniProgram: When clicked, this type of menu will obtain data from the Mini App for business processing to provide to the App

If the button type of the menu is of the onMiniProgram class, the Mini App needs to provide additional call parameters, and it needs to be implemented in the Mini App code to provide the corresponding data. (Features similar to Page api onShareAppMessage)

# 2. More menu examples for MiniApps

For example, more menu items in the APP should implement onMiniProgram types of [Share to DingTalk] and [Share to Sina Weibo] (here only explain the processing that needs to be done in the Mini App)

# 2.1 Share ID

  • Manage background configuration sharing to DingTalk menu ID for ShareDingDing
  • Manage background configuration sharing to Sina Weibo ID for ShareSinaWeibo

# 2.2 Share configuration

In the corresponding page of the Mini App, configure the two functions of onShareDingDingButtonHandler and onShareSinaWeiboButtonHandler (if the corresponding function is not configured, the SDK will not display the corresponding menu)

MiniApp configuration method:
on{id}ButtonHandler(id is capitalized)
After the funtion call, it needs to return information such as title and appInfo, which will be transmitted to the SDK for processing

The whole process:
When you click the Share to DingTalk menu item, the onShareDingDingButtonHandler function is invoked to return the data and pass it through to the SDK for processing

note

In the Mini App code, in order to unify the naming and specification with onShareAppMessage, the ID will be uniformly changed to the first capitalization when processing.

More examples

  • The ID is shareWeibo, and the Mini App needs to configure onShareWeiboButtonHandler;
  • The ID is shareDingDing, and the Mini App needs to configure onShareDingDingButtonHandler;
  • The ID is doSomething, the Mini App needs to configure onDoSomethingButtonHandler;
  • The ID is ShareQQ, the Mini App needs to configure onShareQQButtonHandler.
Last update: 2022/08/16, 21:24:25
FXML
Other

← FXML Other→

Copyright © 2020-2024 Neuxnet
  • Follow System
  • Light Mode
  • Dark Mode
  • Reading Mode