Push notification XCode 8,无法接收推送通知
升级到XCode 8后,我的iphone和IOS 10将无法再接收推送通知Push notification XCode 8,无法接收推送通知,push-notification,xcode8,Push Notification,Xcode8,升级到XCode 8后,我的iphone和IOS 10将无法再接收推送通知 我已启用“自动管理签名” 我从苹果网站重新生成证书,通用的 我的本地代码正在运行,没有任何错误 我可以使用代码正确获取设备令牌(swift 3): func应用程序(application:UIApplication,didFinishLaunchingWithOptions launchOptions:[UIApplicationLaunchOptions:[UIApplicationLaunchOptions:任何
- 我已启用“自动管理签名”
- 我从苹果网站重新生成证书,通用的
- 我的本地代码正在运行,没有任何错误
- 我可以使用代码正确获取设备令牌(swift 3):
func应用程序(application:UIApplication,didFinishLaunchingWithOptions launchOptions:[UIApplicationLaunchOptions:[UIApplicationLaunchOptions:任何]?)->Bool{
} func应用程序(application:UIApplication,DidRegisterForRemotionTificationswithDeviceToken deviceToken:Data){print("start didFinishLaunchingWithOptions") // Register the supported interaction types. let types = UIUserNotificationType([.alert, .badge, .sound]) let mySettings = UIUserNotificationSettings(types: types, categories: nil) UIApplication.shared.registerUserNotificationSettings(mySettings) // Register for remote notifications. UIApplication.shared.registerForRemoteNotifications() return true
- 我的apns主题与我的应用程序包id相同
* Trying 17.188.135.156... * Connected to api.push.apple.com (17.188.135.156) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * successfully set certificate verify locations: * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * SSL connection using TLSv1.2 / ECxxxxxxxxxxxxxxxxxx * ALPN, server accepted to use h2 * Server certificate: * subject: CN=api.push.apple.com; OU=management:idms.group.533599; O=Apple Inc.; ST=California; C=US * start date: Aug 28 19:03:46 2015 GMT * expire date: Sep 26 19:03:46 2017 GMT * subjectAltName: host "api.push.apple.com" matched cert's "api.push.apple.com" * issuer: CN=Apple IST CA 2 - G1; OU=Certification Authority; O=Apple Inc.; C=US * SSL certificate verify ok. * Using HTTP2, server supports multi-use * Connection state changed (HTTP/2 confirmed) * TCP_NODELAY set * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 * Using Stream ID: 1 (easy handle 0x7f2d6eda3970) > POST /3/device/3xxxxxxxxxxxxxxxxxx HTTP/1.1 Host: api.push.apple.com Accept: */* apns-topic: xxxxxxxxxx apns-expiration: 0 Content-Length: 316 Content-Type: application/x-www-form-urlencoded * Connection state changed (MAX_CONCURRENT_STREAMS updated)! * We are completely uploaded and fine < HTTP/2.0 200 < apns-id:AF034xxxxxxxxxxxx0F9F27 < * Connection #0 to host api.push.apple.com left intact
有人能帮我吗?有人能帮我吗?*正在尝试17.188.135.156。。。 *连接到api.push.apple.com(17.188.135.156)端口443(#0) *阿尔卑斯山,提供h2 *ALPN,提供http/1.1 *密码选择:全部:!导出:!导出40:!导出56:!全部:!低:!RC4:@STRENGTH *已成功设置证书验证位置: *CAfile:/etc/pki/tls/certs/ca-bundle.crt 卡帕斯:没有 *使用TLSv1.2/ECXXXXXXXXXXXXXXXX的SSL连接 *ALPN,服务器接受使用h2 *服务器证书: *主题:CN=api.push.apple.com;OU=management:idms.group.533599;O=apple Inc;ST=California;C=US *开始日期:2015年8月28日19:03:46 GMT *到期日期:2017年9月26日19:03:46 GMT *subjectAltName:主机“api.push.apple.com”匹配证书的“api.push.apple.com” *发行人:CN=苹果IST CA 2-G1;OU=认证机构;O=苹果公司;C=美国 *SSL证书验证正常。 *使用HTTP2,服务器支持多用途 *连接状态已更改(HTTP/2已确认) *TCP_节点集 *升级后正在将流缓冲区中的HTTP/2数据复制到连接缓冲区:len=0 *使用流ID:1(易处理0x7f2d6eda3970) >POST/3/device/3xxxxxxxxxxxxxxx HTTP/1.1 主持人:api.push.apple.com 接受:*/* apns主题:XXXXXXXXX apns过期时间:0 内容长度:316 内容类型:application/x-www-form-urlencoded *连接状态已更改(最大并发流已更新)! *我们是完全上传和罚款
$change_alert = "{ \"aps\": { \"alert\": \"$alert_message\", \"badge\": $badge, \"sound\": \"default\" }, \"xxxxxxxx\": \"$xxxxxx\" }"; $url = "https://api.development.push.apple.com/3/device/$device_token"; //$url = "https://api.push.apple.com/3/device/$device_token"; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $change_alert); curl_setopt($ch, CURLOPT_HTTPHEADER, array("apns-topic: $apns_topic", "apns-expiration: $apns_expiration")); curl_setopt($ch, CURLOPT_SSLCERT, $pem_file); //curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $pem_secret); $response = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch);
* Trying 17.188.135.156... * Connected to api.push.apple.com (17.188.135.156) port 443 (#0) * ALPN, offering h2 * ALPN, offering http/1.1 * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH * successfully set certificate verify locations: * CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none * SSL connection using TLSv1.2 / ECxxxxxxxxxxxxxxxxxx * ALPN, server accepted to use h2 * Server certificate: * subject: CN=api.push.apple.com; OU=management:idms.group.533599; O=Apple Inc.; ST=California; C=US * start date: Aug 28 19:03:46 2015 GMT * expire date: Sep 26 19:03:46 2017 GMT * subjectAltName: host "api.push.apple.com" matched cert's "api.push.apple.com" * issuer: CN=Apple IST CA 2 - G1; OU=Certification Authority; O=Apple Inc.; C=US * SSL certificate verify ok. * Using HTTP2, server supports multi-use * Connection state changed (HTTP/2 confirmed) * TCP_NODELAY set * Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0 * Using Stream ID: 1 (easy handle 0x7f2d6eda3970) > POST /3/device/3xxxxxxxxxxxxxxxxxx HTTP/1.1 Host: api.push.apple.com Accept: */* apns-topic: xxxxxxxxxx apns-expiration: 0 Content-Length: 316 Content-Type: application/x-www-form-urlencoded * Connection state changed (MAX_CONCURRENT_STREAMS updated)! * We are completely uploaded and fine < HTTP/2.0 200 < apns-id:AF034xxxxxxxxxxxx0F9F27 < * Connection #0 to host api.push.apple.com left intact