This is a creation in Article, where the information may have evolved or changed.
Here's an example of an iOS message push implemented in the Go language
Package Mainimport ("FMT" "Github.com/virushuo/go-apns" "OS" "Time") Func main () {APN, err: = Apns. New ("Apns_dev_cert.pem", "Apns_dev_key.pem", "gateway.sandbox.push.apple.com:2195", 1*time. Second) If err! = Nil {fmt. Printf ("Connect error:%s\n", err. Error ()) OS. Exit (1)}fmt. Println ("Connect successed!") Go Readerror (APN. Errorchan) Token: = "Your device token" payload: = APNs. Payload{}payload. Aps.Alert.Body = "Hello world! 0 "Notification: = APNs. Notification{}notification. Devicetoken = tokennotification. Identifier = 0notification. Payload = &payloaderr = APN. Send (¬ification) fmt. PRINTF ("Send ID (%x):%s\n", notification. Identifier, ERR) notification. Identifier++notification. Payload.Aps.Alert.Body = "Hello world! 1 "err = APN. Send (¬ification) fmt. PRINTF ("Send ID (%x):%s\n", notification. Identifier, ERR) notification. Identifier++notification. Payload.Aps.Alert.Body = "Hello world! 2 "err = APN. Send (¬ification) fmt. PRINTF ("Send ID (%x):%s\n", notification. Identifier, ERR) notification. Identifier++notification. Devicetoken = "" Notification. Payload.Aps.Alert.Body = "Hello world! 3 "err = APN. Send (¬ification) fmt. PRINTF ("Send ID (%x):%s\n", notification. Identifier, Err) time. Sleep (1E9) notification. Identifier++notification. Devicetoken = tokennotification. Payload.Aps.Alert.Body = "Re Hello world! 0 "err = APN. Send (¬ification) fmt. PRINTF ("Send ID (%x):%s\n", notification. Identifier, ERR) notification. Identifier++notification. Devicetoken = "" Notification. Payload.Aps.Alert.Body = "Re Hello world! 1 "err = APN. Send (¬ification) fmt. PRINTF ("Send ID (%x):%s\n", notification. Identifier, Err) time. Sleep (1E9) notification. Identifier++notification. Devicetoken = tokennotification. Payload.Aps.Alert.Body = "Rere Hello world! 0 "err = APN. Send (¬ification) fmt. PRINTF ("Send ID (%x):%s\n", notification. Identifier, Err) time. Sleep (2E9) notification. Identifier++notification. Devicetoken = tokennotification. Payload.Aps.Alert.Body = "Rere Hello world! 1 "err = APN. Send (¬ification) fmt. PRINTF ("Send ID (%x):%s\n", notification. IdenTifier, Err) time. Sleep (2E9) APN. Close ()}func readerror (Errorchan <-chan error) {for {apnerror: = <-errorchanfmt.println (Apnerror). Error ())}}