diff --git a/zh-cn/release-notes/api-change/v3.1-beta/changelog-v3.1-beta.md b/zh-cn/release-notes/api-change/v3.1-beta/changelog-v3.1-beta.md index 5e7ba47b26108978dcb4eb40f9e7b31aa3caf9bc..0cc090d398f09378f752373dd6cf9adf7d322ba4 100644 --- a/zh-cn/release-notes/api-change/v3.1-beta/changelog-v3.1-beta.md +++ b/zh-cn/release-notes/api-change/v3.1-beta/changelog-v3.1-beta.md @@ -21,6 +21,26 @@ sendRequest(code: number, data: MessageParcel, reply: MessageParcel, options: Me ``` import rpc from "@ohos.rpc" +import FA from "@ohos.ability.featureAbility"; + +let proxy; +let connect = { + onConnect: function(elementName, remoteProxy) { + console.log("RpcClient: js onConnect called."); + proxy = remoteProxy; + }, + onDisconnect: function(elementName) { + console.log("RpcClient: onDisconnect"); + }, + onFailed: function() { + console.log("RpcClient: onFailed"); + } +}; +let want = { + "bundleName": "com.ohos.server", + "abilityName": "com.ohos.server.MainAbility", +}; +FA.connectAbility(want, connect); let option = new rpc.MessageOption() let data = rpc.MessageParcel.create()