APNS/2Go 苹果消息推送
APNS/2 是一个 Go 语言实现的 Apple Push Notifications on iOS, OSX 和 Safari 开发包,使用全新的 HTTP/2 Push provider API,特点是简单、灵活和快速。
特性:
-
使用全新 Apple APNs HTTP/2 连接
-
支持老版本的 Go 1.4.x 以及以后的 Go 语言版本
-
支持到 APNs 的持久化连接
-
快速、模块化和易用
-
在 APNs 产品环境中测试通过
示例代码:
package main import ( apns "github.com/sideshow/apns2" "github.com/sideshow/apns2/certificate" "log" ) func main() { cert, pemErr := certificate.FromPemFile("../cert.pem", "") if pemErr != nil { log.Println("Cert Error:", pemErr) } notification := &apns.Notification{} notification.DeviceToken = "11aa01229f15f0f0c52029d8cf8cd0aeaf2365fe4cebc4af26cd6d76b7919ef7" notification.Topic = "com.sideshow.Apns2" notification.Payload = []byte(`{"aps":{"alert":"Hello!"}}`) // See Payload section below client := apns.NewClient(cert).Development() res, err := client.Push(notification) if err != nil { log.Println("Error:", err) return } }
评论
APNS苹果消息推送服务
APNS-ApplePushNotificationService'sphpextension苹果消息推送服务,基于PHP扩展(Extension)所开发的APNS消息推送模块示例代码:<?ph
APNS苹果消息推送服务
0
Knuff苹果推送消息服务调试应用
Knuff是APNs(ApplePushNotificationService,苹果信息推送服务)的调试应用。特性:向APNS(ApplePushNotificationService)发送推送通知非
Knuff苹果推送消息服务调试应用
0