【问题标题】:Azure Notification Hub doesn't work with enterprise releaseAzure 通知中心不适用于企业版
【发布时间】:2021-06-10 11:17:32
【问题描述】:

当我从 Xcode 在 iPad 上运行我的应用程序时,一切正常。但是当我做企业发布时,推送通知没有出现。

这是我的注册码:

func registerForAzurePushNotifications() {
    let connectionString = "Endpoint=sb://xyz="
    let hubName = "POC"

    // Creates with alert, badge and sound
    let hubOptions = MSNotificationHubOptions(withOptions: [.alert, .badge, .sound])
    // Starts MSNotificationHub SDK
    MSNotificationHub.start(connectionString: connectionString, hubName: hubName, options: hubOptions!)
    // Get the Device identifier
    var deviceTag = ""
    // Creates tags with type_value format
    if let id = UIDevice.current.identifierForVendor?.uuidString{
       deviceTag = id
    }
    MSNotificationHub.addTags([deviceTag]) 
}

获取通知的代码

func notificationHub(_ notificationHub: MSNotificationHub, didReceivePushNotification notification: MSNotificationHubMessage) {
    let title = notification.title ?? ""
    let body = notification.body ?? ""
    print("Notification received: title:\"\(title)\" body:\"\(body)\"")
}

Azure 门户响应

对我做错了什么有什么看法?

【问题讨论】:

  • 您是否在通知中心选择了生产模式?
  • 谢谢,我会检查的。它处于沙盒模式。我会再试一次
  • @Paulw11 将其更改为生产模式后,推送通知测试失败。 “由于未知错误,无法发送通知”
  • 你是用token还是证书认证?
  • 我正在使用证书进行身份验证。

标签: ios swift azure azure-notificationhub


【解决方案1】:

您需要上传调试和发布模式的证书。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-03-28
    • 1970-01-01
    • 2013-10-10
    • 1970-01-01
    • 1970-01-01
    • 2018-07-29
    • 1970-01-01
    相关资源
    最近更新 更多