【问题标题】:How to connect ios cordova app to apple push notifications如何将 ios cordova 应用程序连接到苹果推送通知
【发布时间】:2020-07-16 01:04:51
【问题描述】:

我有一个带有cordova-plugin-firebasex 的cordova 应用程序。它在 ios 和 android 上完美运行,除了一件事:

ios 上没有系统通知

我的应用从 firebase 接收数据消息,但我无法从 firebase 控制台向 ios 系统通知中心发送通知。

  1. 我创建了 Apple 开发者证书并将其安装在我的 Mac 上
  2. 我创建了 iOS 分发证书并将其安装在我的 Mac 上
  3. 我创建了一个带有推送通知的新标识符
  4. 为推送通知创建了两个证书(dev 和 dist)并将其安装在我的 Mac 上
  5. 为 dist 和 dev 创建配置文件并将其安装在我的 Mac 上
  6. 创建了新的 cordova 项目并安装了 cordova-plugin-firebasex。已成功安装所有 Pod。
  7. 在 XCode 和 Signing & Capabilities 下载中打开项目并选择我的配置文件进行调试和发布
  8. 签名和功能中存在推送通知。

然后我在我的应用程序中创建了一个大 APNS 按钮来显示我的 apns 令牌,创建存档并将其上传到 TestFlight。

但是当我在 iPhone SE 上安装我的应用程序时 - 我没有看到关于允许推送通知的对话框。当我按下我的大 APNS 按钮时 - 我看到了 null

我该如何解决这个问题?

【问题讨论】:

    标签: ios firebase cordova apple-push-notifications cordova-plugins


    【解决方案1】:

    已修复

    FirebasePlugin.grantPermission(function(hasPermission){
        console.log("Permission was " + (hasPermission ? "granted" : "denied"));
    });
    

    【讨论】:

      猜你喜欢
      • 2021-11-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多