智能客服
你问我答,随时在线为你解决问题

























您当前正在浏览HarmonyOS开发者3.0版本配套的开发者文档,对应API能力级别为API 8 Release。此版本文档已归档不再维护,推荐您使用HarmonyOS NEXT版本。
收起 自动换行 深色代码主题 复制 |
Since:
3Modifier and Type | Method | Description |
|---|---|---|
boolean | onRemoteRequest(int code, MessageParcel data, MessageParcel reply, MessageOption option) | Called when an internal ability request is received from the local ability. |
boolean onRemoteRequest(int code, MessageParcel data, MessageParcel reply, MessageOption option) throws RemoteException
Called when an internal ability request is received from the local ability. You can implement this method to process the request, such as calling, subscribing, and unsubscribing the internal ability.You need to specify the service code and request data of the internal ability. The request data structures vary depending on the request types.
Before publishing your JavaScript APIs, ensure that the service codes and request data structures are forward-compatible.
Parameters:
Parameter Name | Parameter Description |
|---|---|
code | Indicates the service code sent from the JavaScript side. Note that the service code must be forward-compatible. |
data | Indicates the request data, which is a MessageParcel object sent from the JavaScript side. Note that the JSON string representation of the object must be forward-compatible. |
reply | Indicates the response message, which is a MessageParcel object returned by the local service. Currently, the value can only be a string or null. |
option | Indicates whether the operation is synchronous or asynchronous. |
Returns:
Returns true if the internal ability operation is successful; returns false otherwise.
Throws:
Throw Name | Throw Description |
|---|---|
Throws this exception if an error occurs during remote processing. |
Since:
3
智能客服
你问我答,随时在线为你解决问题
合作咨询
我们的专家服务团队将竭诚为您提供专业的合作咨询服务
解决方案
精准高效的一站式服务支持,助力开发者商业成功