推送通知即将在我的iPhone和iPad上发布,但是当我发送它时它不会出现在另一部iPhone上。我不明白为什么它不会来。我已经创建了所有必需的证书。添加设备ID。仍然没有来。请帮忙。(这是沙箱模式)。
当我尝试使用https://pushtry.com发送通知时,我收到以下错误
错误响应命令:8标识符:0状态:8-无效令牌
脚步:
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
var deviceTokenStr = deviceToken.description.replacingOccurrences(of: ">", with: "", options: .caseInsensitive, range: nil)
deviceTokenStr = deviceTokenStr.replacingOccurrences(of: "<", with: "", options: .caseInsensitive, range: nil)
deviceTokenStr = deviceTokenStr.replacingOccurrences(of: " ", with: "", options: .caseInsensitive, range: nil)
print(deviceTokenStr)
}
这个方法被调用,即所有设备都已注册推送通知服务
现在,在上面的方法中,获取您的推送通知令牌“deviceToeknStr”并使用它来检查使用站点的推送通知
在调试模式下使用您的pem文件,证书的密码和devicetokenStr。