未验证 提交 345f18aa 编写于 作者: Q ql 提交者: Gitee

update zh-cn/application-dev/ability/fa-serviceability.md.

Signed-off-by: Nql <qianli16@huawei.com>
上级 7b842927
......@@ -208,6 +208,7 @@ function onFailedCallback(code){
```ts
import deviceManager from '@ohos.distributedHardware.deviceManager';
var dmClass;
function getRemoteDeviceId() {
if (typeof dmClass === 'object' && dmClass != null) {
var list = dmClass.getTrustedDeviceListSync();
......@@ -243,6 +244,8 @@ var connId = featureAbility.connectAbility(
在跨设备场景下,需要向用户申请数据同步的权限。具体示例代码如下:
```ts
import accessControl from "@ohos.abilityAccessCtrl";
import bundle from '@ohos.bundle';
async function RequestPermission() {
console.info('RequestPermission begin');
let array: Array<string> = ["ohos.permission.DISTRIBUTED_DATASYNC"];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册