我正在发送这样的推送通知:
var items:[APNSNotificationItem] = [.customPayload("body",body),.contentAvailable]
if alert
{
items.append(.badge(badge))
items.append(.alertBody(message))
items.append(.alertTitle(title))
items.append(.sound("default"))
}
let n = NotificationPusher(apnsTopic: Constants.notificationsAppId)
n.pushAPNS(
configurationName: notificationsAppId,
deviceTokens: deviceIDs,
notificationItems: items) {
responses in
LogFile.debug("Notification Result:"+String(describing:responses))
}
它最初工作正常,响应如下所示:
Notification Result:[200 OK: ]
但是服务运行一段时间后,它最终看起来像这样
Notification Result:[500 Internal Server Error: Unable to write frame]
并且没有发送通知。重新启动服务就可以了。
什么可能导致此问题?
编辑:当本地实例在没有活动的情况下运行了几个小时时,这也会在 Mac OS X 上发生