export const getUserToken = () => {
let result = "";
setupWebViewJavascriptBridge((bridge) => {
bridge.callHandler("fetchUserInfo", (data) => {
//
result = data;
});
});
return result;
};
this is an interactive method between h5 and iOS, that is, an iOS method is called, iOS returns a parameter, and iOS is returned in a callback method. Calling this method returns the default empty string before it can be copied to result. Ask the gods to guide you how to write to return the normal results?