The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **addDeathRecippient()** of the proxy object is called to add a callback for receiving the death notification of the remove object.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **addDeathRecipient()** of the proxy object is called to add a callback for receiving the death notification of the remove object.
```ts
classMyDeathRecipient{
...
...
@@ -6786,7 +6788,7 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
```ts
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letconnect={
onConnect:function(elementName,remoteProxy){
...
...
@@ -6804,10 +6806,10 @@ For details about the error codes, see [RPC Error Codes](../errorcodes/errorcode
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
};
// Use this method to connect to the ability for the FA model.
The proxy object in the **onConnect** callback can be assigned a value only after the ability is connected asynchronously. Then, **getDescriptor()** of the proxy object is called to obtain the interface descriptor of the object.
...
...
@@ -6986,7 +6988,7 @@ Obtains the interface descriptor of this proxy object.
```ts
// Import @ohos.ability.featureAbility only for the application developed based on the FA model.
// import FA from "@ohos.ability.featureAbility";
letproxy;
letconnect={
onConnect:function(elementName,remoteProxy){
...
...
@@ -7004,10 +7006,10 @@ Obtains the interface descriptor of this proxy object.
"bundleName":"com.ohos.server",
"abilityName":"com.ohos.server.EntryAbility",
};
// Use this method to connect to the ability for the FA model.