You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级至SDK 33(Android 13)后通知功能失效求助

TargetSDK 升级到33后,Android 13通知库权限异常问题

问题概述

为满足Google Play商店最低TargetSDK版本33的要求,升级后两款通知库在Android 13上无法正常申请权限:

受影响的库

  • awesome-cordova-plugins/local-notifications/ngx(本地通知)
  • cordova-plugin-fcm-with-dependecy-updated/ionic/ngx(FCM)

已尝试的无效操作

在Android Manifest中添加了无关权限:

<uses-permission android:name="android.permission.NFC" />

权限申请异常表现

本地通知库

调用requestPermission()直接返回false,未触发权限申请弹窗:

async askForLocalNotificationPermission() {
    if (this.platform.is('android')) {
      const hasPermission = await this.localNotifications.requestPermission();

      if (hasPermission) {
        console.log('Notification permission granted');
      } else {
        console.log('Notification permission denied');
      }
    }
  }

FCM库

调用requestPermission()直接返回true,同样未弹出权限申请弹窗:

async askForFCMNotificationPermission() {
    if (this.platform.is('android')) {
      const hasPermission = await this.fcm.requestPermission();

      if (hasPermission) {
        console.log('Notification permission granted');
      } else {
        console.log('Notification permission denied');
      }
    }
  }

内容的提问来源于stack exchange,提问作者Yeo Bryan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 00:26:03