未验证 提交 cdfc8c46 编写于 作者: 耿文广 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-defaultAppManager.md.

Signed-off-by: N耿文广 <gengwenguang@huawei.com>
上级 35f40311
...@@ -63,11 +63,13 @@ isDefaultApplication(type: string): Promise\<boolean> ...@@ -63,11 +63,13 @@ isDefaultApplication(type: string): Promise\<boolean>
```ts ```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
import { BusinessError } from '@ohos.base';
defaultAppMgr.isDefaultApplication(defaultAppMgr.ApplicationType.BROWSER) defaultAppMgr.isDefaultApplication(defaultAppMgr.ApplicationType.BROWSER)
.then((data: defaultAppMgr.AsyncCallback<boolean>) => { .then((data) => {
console.info('Operation successful. IsDefaultApplication ? ' + JSON.stringify(data)); console.info('Operation successful. IsDefaultApplication ? ' + JSON.stringify(data));
}).catch((error) => { }).catch((error: BusinessError) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error)); console.error('Operation failed. Cause: ' + JSON.stringify(error));
}); });
``` ```
...@@ -92,13 +94,13 @@ isDefaultApplication(type: string, callback: AsyncCallback\<boolean>): void ...@@ -92,13 +94,13 @@ isDefaultApplication(type: string, callback: AsyncCallback\<boolean>): void
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
defaultAppMgr.isDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, (err: BusinessError, data: defaultAppMgr.AsyncCallback<boolean>) => { defaultAppMgr.isDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful. IsDefaultApplication ? ' + JSON.stringify(data)); console.info('Operation successful. IsDefaultApplication ? ' + JSON.stringify(data));
}); });
``` ```
## defaultAppMgr.isDefaultApplicationSync<sup>10+</sup> ## defaultAppMgr.isDefaultApplicationSync<sup>10+</sup>
...@@ -126,12 +128,12 @@ isDefaultApplicationSync(type: string): boolean; ...@@ -126,12 +128,12 @@ isDefaultApplicationSync(type: string): boolean;
```ts ```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
defaultAppMgr.isDefaultApplicationSync(defaultAppMgr.ApplicationType.BROWSER) try {
.then((data: defaultAppMgr.AsyncCallback<boolean>) => { let data = defaultAppMgr.isDefaultApplicationSync(defaultAppMgr.ApplicationType.BROWSER)
console.info('Operation successful. IsDefaultApplicationSync ? ' + JSON.stringify(data)); console.info('Operation successful. IsDefaultApplicationSync ? ' + JSON.stringify(data));
}).catch((error) => { } catch(error) {
console.error('Operation failed. Cause: ' + JSON.stringify(error)); console.error('Operation failed. Cause: ' + JSON.stringify(error));
}); };
``` ```
## defaultAppMgr.getDefaultApplication ## defaultAppMgr.getDefaultApplication
...@@ -173,21 +175,23 @@ getDefaultApplication(type: string, userId?: number): Promise\<BundleInfo> ...@@ -173,21 +175,23 @@ getDefaultApplication(type: string, userId?: number): Promise\<BundleInfo>
```ts ```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
import { BusinessError } from '@ohos.base';
defaultAppMgr.getDefaultApplication(defaultAppMgr.ApplicationType.BROWSER) defaultAppMgr.getDefaultApplication(defaultAppMgr.ApplicationType.BROWSER)
.then((data: defaultAppMgr.AsyncCallback<BundleInfo>) => { .then((data) => {
console.info('Operation successful. bundleInfo: ' + JSON.stringify(data)); console.info('Operation successful. bundleInfo: ' + JSON.stringify(data));
}) })
.catch((error) => { .catch((error: BusinessError) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error)); console.error('Operation failed. Cause: ' + JSON.stringify(error));
}); });
defaultAppMgr.getDefaultApplication("image/png") defaultAppMgr.getDefaultApplication("image/png")
.then((data: defaultAppMgr.AsyncCallback<BundleInfo>) => { .then((data) => {
console.info('Operation successful. bundleInfo: ' + JSON.stringify(data)); console.info('Operation successful. bundleInfo: ' + JSON.stringify(data));
}) })
.catch((error) => { .catch((error: BusinessError) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error)); console.error('Operation failed. Cause: ' + JSON.stringify(error));
}); });
``` ```
## defaultAppMgr.getDefaultApplication ## defaultAppMgr.getDefaultApplication
...@@ -227,20 +231,20 @@ import defaultAppMgr from '@ohos.bundle.defaultAppManager'; ...@@ -227,20 +231,20 @@ import defaultAppMgr from '@ohos.bundle.defaultAppManager';
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
let userId = 100; let userId = 100;
defaultAppMgr.getDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, userId, (err: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.getDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, userId, (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful. bundleInfo:' + JSON.stringify(data)); console.info('Operation successful. bundleInfo:' + JSON.stringify(data));
}); });
defaultAppMgr.getDefaultApplication("image/png", userId, (err: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.getDefaultApplication("image/png", userId, (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful. bundleInfo:' + JSON.stringify(data)); console.info('Operation successful. bundleInfo:' + JSON.stringify(data));
}); });
``` ```
...@@ -278,19 +282,19 @@ getDefaultApplication(type: string, callback: AsyncCallback\<BundleInfo>) : void ...@@ -278,19 +282,19 @@ getDefaultApplication(type: string, callback: AsyncCallback\<BundleInfo>) : void
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
defaultAppMgr.getDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, (err: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.getDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful. bundleInfo:' + JSON.stringify(data)); console.info('Operation successful. bundleInfo:' + JSON.stringify(data));
}); });
defaultAppMgr.getDefaultApplication("image/png", (err: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.getDefaultApplication("image/png", (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful. bundleInfo:' + JSON.stringify(data)); console.info('Operation successful. bundleInfo:' + JSON.stringify(data));
}); });
``` ```
...@@ -333,21 +337,19 @@ getDefaultApplicationSync(type: string, userId?: number): BundleInfo; ...@@ -333,21 +337,19 @@ getDefaultApplicationSync(type: string, userId?: number): BundleInfo;
```ts ```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
defaultAppMgr.getDefaultApplicationSync(defaultAppMgr.ApplicationType.BROWSER) try {
.then((data: defaultAppMgr.AsyncCallback<BundleInfo>) => { let data = defaultAppMgr.getDefaultApplicationSync(defaultAppMgr.ApplicationType.BROWSER)
console.info('Operation successful. bundleInfo: ' + JSON.stringify(data)); console.info('Operation successful. bundleInfo: ' + JSON.stringify(data));
}) } catch(error) {
.catch((error) => { console.error('Operation failed. Cause: ' + JSON.stringify(error));
console.error('Operation failed. Cause: ' + JSON.stringify(error)); };
});
try {
defaultAppMgr.getDefaultApplicationSync("image/png") let data = defaultAppMgr.getDefaultApplicationSync("image/png")
.then((data: defaultAppMgr.AsyncCallback<BundleInfo>) => { console.info('Operation successful. bundleInfo: ' + JSON.stringify(data));
console.info('Operation successful. bundleInfo: ' + JSON.stringify(data)); } catch(error) {
}) console.error('Operation failed. Cause: ' + JSON.stringify(error));
.catch((error) => { };
console.error('Operation failed. Cause: ' + JSON.stringify(error));
});
``` ```
## defaultAppMgr.setDefaultApplication ## defaultAppMgr.setDefaultApplication
...@@ -390,28 +392,30 @@ setDefaultApplication(type: string, elementName: ElementName, userId?: number): ...@@ -390,28 +392,30 @@ setDefaultApplication(type: string, elementName: ElementName, userId?: number):
```ts ```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
let info: defaultAppMgr.ElementName = { import { BusinessError } from '@ohos.base';
bundleName: "com.example.myapplication",
moduleName: "module01", let info = {
abilityName: "EntryAbility" bundleName: "com.example.myapplication",
moduleName: "module01",
abilityName: "EntryAbility"
} }
defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, info).then((data: defaultAppMgr.AsyncCallback<void>) => { defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, info).then((data) => {
console.info('Operation successful.'); console.info('Operation successful.');
}).catch((error) => { }).catch((error: BusinessError) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error)); console.error('Operation failed. Cause: ' + JSON.stringify(error));
}); });
let userId = 100; let userId = 100;
defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, info, userId).then((data: defaultAppMgr.AsyncCallback<void>) => { defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, info, userId).then((data) => {
console.info('Operation successful.'); console.info('Operation successful.');
}).catch((error) => { }).catch((error: BusinessError) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error)); console.error('Operation failed. Cause: ' + JSON.stringify(error));
}); });
defaultAppMgr.setDefaultApplication("image/png", info, userId).then((data: defaultAppMgr.AsyncCallback<void>) => { defaultAppMgr.setDefaultApplication("image/png", info, userId).then((data) => {
console.info('Operation successful.'); console.info('Operation successful.');
}).catch((error) => { }).catch((error: BusinessError) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error)); console.error('Operation failed. Cause: ' + JSON.stringify(error));
}); });
``` ```
...@@ -453,26 +457,26 @@ import defaultAppMgr from '@ohos.bundle.defaultAppManager'; ...@@ -453,26 +457,26 @@ import defaultAppMgr from '@ohos.bundle.defaultAppManager';
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
let userId = 100; let userId = 100;
let info: defaultAppMgr.ElementName = { let info = {
bundleName: "com.example.myapplication", bundleName: "com.example.myapplication",
moduleName: "module01", moduleName: "module01",
abilityName: "EntryAbility" abilityName: "EntryAbility"
} }
defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, info, userId, (errerr: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, info, userId, (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful.'); console.info('Operation successful.');
}); });
defaultAppMgr.setDefaultApplication("image/png", info, userId, (errerr: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.setDefaultApplication("image/png", info, userId, (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful.'); console.info('Operation successful.');
}); });
``` ```
## defaultAppMgr.setDefaultApplication ## defaultAppMgr.setDefaultApplication
...@@ -510,26 +514,26 @@ setDefaultApplication(type: string, elementName: ElementName, callback: AsyncCal ...@@ -510,26 +514,26 @@ setDefaultApplication(type: string, elementName: ElementName, callback: AsyncCal
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
let info: defaultAppMgr.ElementName = { let info = {
bundleName: "com.example.myapplication", bundleName: "com.example.myapplication",
moduleName: "module01", moduleName: "module01",
abilityName: "EntryAbility" abilityName: "EntryAbility"
} }
defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, info, (err: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.setDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, info, (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful.'); console.info('Operation successful.');
}); });
defaultAppMgr.setDefaultApplication("image/png", info, (err: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.setDefaultApplication("image/png", info, (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful.'); console.info('Operation successful.');
}); });
``` ```
## defaultAppMgr.setDefaultApplicationSync<sup>10+</sup> ## defaultAppMgr.setDefaultApplicationSync<sup>10+</sup>
...@@ -566,29 +570,32 @@ setDefaultApplicationSync(type: string, elementName: ElementName, userId?: numbe ...@@ -566,29 +570,32 @@ setDefaultApplicationSync(type: string, elementName: ElementName, userId?: numbe
```ts ```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
let info: defaultAppMgr.ElementName = { let info = {
bundleName: "com.example.myapplication", bundleName: "com.example.myapplication",
moduleName: "module01", moduleName: "module01",
abilityName: "EntryAbility" abilityName: "EntryAbility"
} }
defaultAppMgr.setDefaultApplicationSync(defaultAppMgr.ApplicationType.BROWSER, info).then((data: defaultAppMgr.AsyncCallback<BundleInfo>) => { try {
console.info('Operation successful.'); defaultAppMgr.setDefaultApplicationSync(defaultAppMgr.ApplicationType.BROWSER, info);
}).catch((error) => { console.info('Operation successful.');
console.error('Operation failed. Cause: ' + JSON.stringify(error)); } catch(error) {
}); console.error('Operation failed. Cause: ' + JSON.stringify(error));
};
let userId = 100; let userId = 100;
defaultAppMgr.setDefaultApplicationSync(defaultAppMgr.ApplicationType.BROWSER, info, userId).then((data: defaultAppMgr.AsyncCallback<BundleInfo>) => { try {
console.info('Operation successful.'); defaultAppMgr.setDefaultApplicationSync(defaultAppMgr.ApplicationType.BROWSER, info, userId);
}).catch((error) => { console.info('Operation successful.');
console.error('Operation failed. Cause: ' + JSON.stringify(error)); } catch(error) {
}); console.error('Operation failed. Cause: ' + JSON.stringify(error));
};
defaultAppMgr.setDefaultApplicationSync("image/png", info, userId).then((data: defaultAppMgr.AsyncCallback<BundleInfo>) => {
console.info('Operation successful.'); try {
}).catch((error) => { defaultAppMgr.setDefaultApplicationSync("image/png", info, userId);
console.error('Operation failed. Cause: ' + JSON.stringify(error)); console.info('Operation successful.');
}); } catch(error) {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
};
``` ```
## defaultAppMgr.resetDefaultApplication ## defaultAppMgr.resetDefaultApplication
...@@ -623,22 +630,24 @@ resetDefaultApplication(type: string, userId?: number): Promise\<void> ...@@ -623,22 +630,24 @@ resetDefaultApplication(type: string, userId?: number): Promise\<void>
```ts ```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
import { BusinessError } from '@ohos.base';
let userId = 100; let userId = 100;
defaultAppMgr.resetDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, userId) defaultAppMgr.resetDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, userId)
.then((data: defaultAppMgr.AsyncCallback<void>) => { .then((data) => {
console.info('Operation successful.'); console.info('Operation successful.');
}) })
.catch((error) => { .catch((error: BusinessError) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error)); console.error('Operation failed. Cause: ' + JSON.stringify(error));
}); });
defaultAppMgr.resetDefaultApplication("image/png", userId) defaultAppMgr.resetDefaultApplication("image/png", userId)
.then((data: defaultAppMgr.AsyncCallback<void>) => { .then((data) => {
console.info('Operation successful.'); console.info('Operation successful.');
}) })
.catch((error) => { .catch((error: BusinessError) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error)); console.error('Operation failed. Cause: ' + JSON.stringify(error));
}); });
``` ```
## defaultAppMgr.resetDefaultApplication ## defaultAppMgr.resetDefaultApplication
...@@ -677,20 +686,20 @@ import defaultAppMgr from '@ohos.bundle.defaultAppManager'; ...@@ -677,20 +686,20 @@ import defaultAppMgr from '@ohos.bundle.defaultAppManager';
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
let userId = 100; let userId = 100;
defaultAppMgr.resetDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, userId, (err: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.resetDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, userId, (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful.'); console.info('Operation successful.');
}); });
defaultAppMgr.resetDefaultApplication("image/png", userId, (err: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.resetDefaultApplication("image/png", userId, (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful.'); console.info('Operation successful.');
}); });
``` ```
...@@ -727,20 +736,20 @@ resetDefaultApplication(type: string, callback: AsyncCallback\<void>) : void; ...@@ -727,20 +736,20 @@ resetDefaultApplication(type: string, callback: AsyncCallback\<void>) : void;
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
import { BusinessError } from '@ohos.base'; import { BusinessError } from '@ohos.base';
defaultAppMgr.resetDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, (err: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.resetDefaultApplication(defaultAppMgr.ApplicationType.BROWSER, (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful.'); console.info('Operation successful.');
}); });
defaultAppMgr.resetDefaultApplication("image/png", (err: BusinessError, data: defaultAppMgr.AsyncCallback<BundleInfo>) => { defaultAppMgr.resetDefaultApplication("image/png", (err: BusinessError, data) => {
if (err) { if (err) {
console.error('Operation failed. Cause: ' + JSON.stringify(err)); console.error('Operation failed. Cause: ' + JSON.stringify(err));
return; return;
} }
console.info('Operation successful.'); console.info('Operation successful.');
}); });
``` ```
...@@ -776,20 +785,19 @@ resetDefaultApplicationSync(type: string, userId?: number): void; ...@@ -776,20 +785,19 @@ resetDefaultApplicationSync(type: string, userId?: number): void;
```ts ```ts
import defaultAppMgr from '@ohos.bundle.defaultAppManager'; import defaultAppMgr from '@ohos.bundle.defaultAppManager';
let userId = 100;
defaultAppMgr.resetDefaultApplicationSync(defaultAppMgr.ApplicationType.BROWSER, userId)
.then((data: defaultAppMgr.AsyncCallback<void>) => {
console.info('Operation successful.');
})
.catch((error) => {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
});
defaultAppMgr.resetDefaultApplicationSync("image/png", userId) let userId = 100;
.then((data: defaultAppMgr.AsyncCallback<void>) => { try {
console.info('Operation successful.'); defaultAppMgr.resetDefaultApplicationSync(defaultAppMgr.ApplicationType.BROWSER, userId);
}) console.info('Operation successful.');
.catch((error) => { } catch(error) {
console.error('Operation failed. Cause: ' + JSON.stringify(error)); console.error('Operation failed. Cause: ' + JSON.stringify(error));
}); };
try {
defaultAppMgr.resetDefaultApplicationSync("image/png", userId);
console.info('Operation successful.');
} catch(error) {
console.error('Operation failed. Cause: ' + JSON.stringify(error));
};
``` ```
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册