go2apns

package module
v0.0.0-...-1ee6863 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 14, 2016 License: MIT Imports: 0 Imported by: 0

README

Go2APNS

Current state is in developing, not production ready!

Introduction

Go2APNS use http/2 protocol to send notification to Apple push notification server for iOS remote notification.

Build & Install

Push API

POST value to http://<host>/push, support keys:

  • token: device token
  • expiration: apns-expiration
  • priority: apns-priority
  • topic: apns-topic
  • payload: body content of the message is the JSON string please see The Remote Notification Payload

All apns-* value please see the APNs Provider API document.

Please check the HTTP status:

  • 200: indicate this push success, and there is no other message
  • 4xx: wrong request, will follow a json object to show you the reason
  • 5xx: server internal error, will follow a json object to show you the reason

json object and error status description please see apple APNs Provider document

Documentation

Overview

Package main provides whole program entry point

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotiResult

type NotiResult struct {
	Code int    // status code for push result
	Msg  string // message if any error occured
}

type Notification

type Notification struct {
	Token      string // device token for this apn
	Id         string // apn-id
	Expiration string // apn-expiration
	Priority   string // apn-priority
	Topic      string // bundle id like com.xxx.app.haha
	Payload    string // alert text conetent

	Result chan NotiResult // push result channel
}

Notification define the data structure for one notification

Directories

Path Synopsis
Package server provides Go2apns entry point
Package server provides Go2apns entry point
act like a http/2 client to APNS Package writer provides methods to write notifications to APNS and keep the http/2 connections with APNS
act like a http/2 client to APNS Package writer provides methods to write notifications to APNS and keep the http/2 connections with APNS

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL