harmony 鸿蒙ArkWeb_WebMessageAPI

2025-06-12 浏览 (1)

ArkWeb_WebMessageAPI

Overview

Defines a native API struct of the post message data. Before calling the API, you are advised to use ARKWEB_MEMBER_MISSING to check whether the function struct has the corresponding pointer to avoid crash caused by mismatch between the SDK and the device ROM.

Since: 12

Related module: Web

Summary

Member Variables

NameDescription
size_t sizeSize of the struct.
ArkWeb_WebMessagePtr(* createWebMessage )()Pointer to the message to create.
void(* destroyWebMessage )(ArkWeb_WebMessagePtr *webMessage)Pointer to the message to destroy.
void(* setType )(ArkWeb_WebMessagePtr webMessage, ArkWeb_WebMessageType type)Pointer to the message type to set.
ArkWeb_WebMessageType(* getType )(ArkWeb_WebMessagePtr webMessage)Pointer to the message type to obtain.
void(* setData )(ArkWeb_WebMessagePtr webMessage, void *data, size_t dataLength)Pointer to the data to set.
void *(* getData )(ArkWeb_WebMessagePtr webMessage, size_t *dataLength)Pointer to the data to obtain.

Member Variable Description

createWebMessage

ArkWeb_WebMessagePtr(* ArkWeb_WebMessageAPI::createWebMessage) ()

Description

Pointer to the message to create.

Returns

Returns the message struct.

destroyWebMessage

void(* ArkWeb_WebMessageAPI::destroyWebMessage) (ArkWeb_WebMessagePtr *webMessage)

Description

Pointer to the message to destroy.

Parameters

NameDescription
webMessageMessage to destroy.

getData

void*(* ArkWeb_WebMessageAPI::getData) (ArkWeb_WebMessagePtr webMessage, size_t *dataLength)

Description

Pointer to the data to obtain.

Parameters

NameDescription
webMessagePointer to the message struct.
dataLengthData length, which is an output parameter.

Returns

Returns the pointer to the data.

getType

ArkWeb_WebMessageType(* ArkWeb_WebMessageAPI::getType) (ArkWeb_WebMessagePtr webMessage)

Description

Pointer to the message type to obtain.

Parameters

NameDescription
webMessagePointer to the message struct.

Returns

Returns the message type.

setData

void(* ArkWeb_WebMessageAPI::setData) (ArkWeb_WebMessagePtr webMessage, void *data, size_t dataLength)

Description

Pointer to the data to set.

Parameters

NameDescription
webMessagePointer to the message struct.
dataPointer to the data.
dataLengthData length.

setType

void(* ArkWeb_WebMessageAPI::setType) (ArkWeb_WebMessagePtr webMessage, ArkWeb_WebMessageType type)

Description

Pointer to the message type to set.

Parameters

NameDescription
webMessagePointer to the message struct.
typeMessage type.

size

size_t ArkWeb_WebMessageAPI::size

Description

Size of the struct.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkWeb API Reference

harmony 鸿蒙ArkWeb_AnyNativeAPI

harmony 鸿蒙ArkWeb_ComponentAPI

harmony 鸿蒙ArkWeb_ControllerAPI

harmony 鸿蒙ArkWeb_CookieManagerAPI

harmony 鸿蒙ArkWeb_JavaScriptBridgeData

harmony 鸿蒙ArkWeb_JavaScriptObject

harmony 鸿蒙ArkWeb_JavaScriptValueAPI

harmony 鸿蒙ArkWeb_ProxyMethod

harmony 鸿蒙ArkWeb_ProxyMethodWithResult

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/y9zqzN