应用在首次打开或运行中,在用户未主动点击权限对应的相关功能或服务时,提前向用户弹窗申请开启【读取全部日程】权限,不符合相关法律法规要求。该问题已被修复。
Signed-off-by: laoyang <laoyang@example.com>
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
import { AbilityConstant, ConfigurationConstant, UIAbility, Want } from '@kit.AbilityKit';
|
||||
import { hilog } from '@kit.PerformanceAnalysisKit';
|
||||
import { window } from '@kit.ArkUI';
|
||||
import { notificationManager } from '@kit.NotificationKit';
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import { BackgroundSyncService } from '../common/BackgroundSyncService';
|
||||
import { LogUtil } from '../common/LogUtil';
|
||||
import { AppSettings } from '../common/AppSettings';
|
||||
|
||||
const DOMAIN = 0x0000;
|
||||
|
||||
@@ -19,24 +17,11 @@ export default class EntryAbility extends UIAbility {
|
||||
BackgroundSyncService.initOnLaunch(this.context);
|
||||
// 服务卡片"添加"按钮跳转:把 widgetAction=add 透传给主页面(在 AppStorage 中暂存)
|
||||
this.handleWidgetParam(want);
|
||||
// 通知权限:日程提醒、后台同步常驻通知都依赖它(系统只弹一次授权框)。
|
||||
// 必须在用户同意《隐私政策》之后才申请 —— 同意前不得申请任何权限;
|
||||
// 首次安装此处跳过,用户点"同意并继续"后由 Index.initPermissionAndLoad() 补申请。
|
||||
AppSettings.getPolicyAgreed(this.context)
|
||||
.then((agreed: boolean): Promise<void> => {
|
||||
if (!agreed) {
|
||||
LogUtil.write('未同意隐私政策:跳过通知权限申请');
|
||||
return Promise.resolve();
|
||||
}
|
||||
return notificationManager.isNotificationEnabled()
|
||||
.then((enabled: boolean): Promise<void> => {
|
||||
if (!enabled) {
|
||||
return notificationManager.requestEnableNotification(this.context).catch((): void => {});
|
||||
}
|
||||
return Promise.resolve();
|
||||
});
|
||||
})
|
||||
.catch((): void => {});
|
||||
// ⚠️ 这里**不再申请任何权限**(含通知权限)。
|
||||
// 依据《审核指南》7.17:应用不得在用户未主动点击对应功能时提前弹窗申请权限。
|
||||
// 通知权限改为在用户主动操作时申请:
|
||||
// ① 保存带提醒的日程(EventEditPage)② 开启「后台持续同步」(SettingsPage)
|
||||
// ③ 设置页「通知权限」→「去开启通知」按钮
|
||||
}
|
||||
|
||||
onDestroy(): void {
|
||||
|
||||
Reference in New Issue
Block a user