Dynamically sets the text in the top bar. The content takes effect only when the current Mini Program is sticky on top. Otherwise, the call can succeed but the settings will not take effect until the Mini Program is sticky on top.
- When this API is successfully called, you must wait for at least 5 seconds to call it again. Otherwise, the callback will fail, and an errMsg of "setTopBarText: fail invoke too frequently" will appear.
(option: Option) => Promise<CallbackResult>
|text||Yes||The text in the top bar|
|complete||No||The callback function used when the API call completed (always executed whether the call succeeds or fails)|
|fail||No||The callback function for a failed API call|
|success||No||The callback function for a successful API call|
text: 'hello, world!'
|API||WeChat Mini-Program||H5||React Native|