iteny / go-apns

go-apns is a simple golang package for ios notification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-apns is apple apns libary providing redis and http protocol to use

feature:

connection pool

support Invalid token filter

message resend

============

install

quick start

create apns client

   apnsConf := apns.Config{}
   apnsOption := apns.NewApnsOption(apnsConf)

   feedback := make(chan *apns.Feedback, 1000)
   //初始化apns
   apnsClient := apns.NewDefaultApnsClient(apnsOption.Cert,
   	apnsOption.PushAddr, chan<- *apns.Feedback(feedback),
   	apnsOption.FeedbackAddr,
   	apns.NewCycleLink(3, apnsOption.StorageCapacity))

build Payload

    aps := apns.Aps{}
	aps.Sound = 
	aps.Badge = 
	aps.Alert = 
	
	//payload
	payload := apns.NewSimplePayLoadWithAps(aps)
Try Send Push
	// send enchanced push
	apnsClient.SendEnhancedNotification(1, math.MaxUint32, apnsToken, *payload)

Donate

image

Contact us

Mail: blackbeans.zc@gmail.com

QQ: 136448723

About

go-apns is a simple golang package for ios notification


Languages

Language:Go 100.0%