Skip to content

Commit

Permalink
修复bug
Browse files Browse the repository at this point in the history
  • Loading branch information
censujiang committed Nov 2, 2023
1 parent de03543 commit c4d32db
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,13 @@ export const notificationPermission = {
plus.ios.deleteObject(app);
plus.ios.deleteObject(UIApplication);
} else {
//首先判断安卓13引入的新权限
result = await requestAndroidPermission('android.permission.POST_NOTIFICATIONS') as boolean
const Build = plus.android.importClass("android.os.Build");
if (Build.VERSION.SDK_INT >= 33) {
//首先判断安卓13引入的新权限
result = await requestAndroidPermission('android.permission.POST_NOTIFICATIONS') as boolean
} else {
result = false
}
//不运行的时候不通知?没关系,我们再试试旧的权限,反正我们只需要知道应用到底能不能发起通知
if (result == false) {
const main = plus.android.runtimeMainActivity();
Expand Down

0 comments on commit c4d32db

Please sign in to comment.