# README
Apnian
About
Apnian is a wrapper around the sideshow/apns2 Apple Push Notification Service library. APNs allows you to send messages to your Apple devices such as an iPhone or Apple Watch.
Usage
Step 1
Create an Apnian config file and place in of of the following four places: .
, ..
, $HOME
, or $GOPATH\config
.
Here's an example called apnian.yaml
:
P8KeyName: YourP8KeyFileName.p8
Topic: TheBundleIdentifierYourSendingNotificationsTo
APNSKeyID: YourAPNSKeyID
TeamID: YourTeamID
Step 2
Place your Apple provided p8 file under $GOPATH/keys
Step 3
Call Apnian from your code:
package main
import (
"fmt"
"github.com/electronicpanopticon/apnian.go"
"log"
)
func main() {
apn, err := apnian.New("apnian")
deviceID := "123456"
apsMessage := apnian.GenerateAPS("Bawk! Bawk! Bawk! 🐔", "default", "https://electronicpanopticon.com")
response, err := apn.Push(deviceID, apsMessage)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%v %v %v\n", response.StatusCode, response.ApnsID, response.Reason)
}
Step 5
Profit!
TODO
- More expressive APS messages
Libraries
Reference
- Local and Remote Notification Programming Guide
- Sending Notification Requests to APNs
- Creating the Remote Notification Payload
TODO
# Functions
No description provided by the author
New returns an Apnian filed with the values in its config file.
# Structs
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author