Skip to content

Instantly share code, notes, and snippets.

@michealzh
Created November 18, 2024 09:46
Show Gist options
  • Save michealzh/78818c0874e792e9de83d783827e76c4 to your computer and use it in GitHub Desktop.
Save michealzh/78818c0874e792e9de83d783827e76c4 to your computer and use it in GitHub Desktop.
鸿蒙 next 获取微信开放平台需要的 Identifier
aboutToAppear(): void {
let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_SIGNATURE_INFO
try {
bundleManager.getBundleInfoForSelf(bundleFlags).then((data) => {
hilog.info(0x0000, 'testTag', 'getBundleInfoForSelf successfully. Data: %{public}s', JSON.stringify(data));
}).catch((err: BusinessError) => {
hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed. Cause: %{public}s', err.message);
});
} catch (err) {
let message = (err as BusinessError).message;
hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', message);
}
window.getLastWindow(getContext(this)).then((lastWindow) => {
this.window = lastWindow
this.window.setWindowLayoutFullScreen(false);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment