Git Product home page Git Product logo

xiaomi-push's Introduction

xiaomi-push

小米推送服务 Golang SDK

Production ready, full golang implementation of Xiaomi Push API (http://dev.xiaomi.com/console/?page=appservice&mod=push)

var client = xiaomipush.NewClient("yourappSecret", []string{"packageName"})

func main() {
    var msg1 *Message = xiaomipush.NewAndroidMessage("title", "body").SetPayload("this is payload1")
    client.Send(context.Background(), msg1, regID1)
}

Sender APIs

  • Send(msg *Message, regID string)
  • SendToList(msg *Message, regIDList []string)
  • SendTargetMessageList(msgList []*TargetedMessage)
  • SendToAlias(msg *Message, alias string)
  • SendToAliasList(msg *Message, aliasList []string)
  • SendToUserAccount(msg *Message, userAccount string)
  • SendToUserAccountList(msg *Message, accountList []string)
  • Broadcast(msg *Message, topic string)
  • BroadcastAll(msg *Message) (*SendResult, error)
  • MultiTopicBroadcast(msg *Message, topics []string, topicOP TopicOP)
  • CheckScheduleJobExist(msgID string)
  • DeleteScheduleJob(msgID string) (*Result, error)
  • DeleteScheduleJobByJobKey(jobKey string) (*Result, error)

Stats APIs

  • Stats(start, end, packageName string)
  • GetMessageStatusByMsgID(msgID string) (*SingleStatusResult, error)
  • GetMessageStatusByJobKey(jobKey string) (*BatchStatusResult, error)
  • GetMessageStatusPeriod(beginTime, endTime int64) (*BatchStatusResult, error)

Subscription APIs

  • SubscribeTopicForRegID(regID, topic, category string) (*Result, error)
  • SubscribeTopicForRegIDList(regIDList []string, topic, category string) (*Result, error)
  • UnSubscribeTopicForRegID(regID, topic, category string) (*Result, error)
  • UnSubscribeTopicForRegIDList(regIDList []string, topic, category string) (*Result, error)
  • SubscribeTopicByAlias(aliases []string, topic, category string) (*Result, error)
  • UnSubscribeTopicByAlias(aliases []string, topic, category string) (*Result, error)

Feedback APIs

  • GetInvalidRegIDs() (*InvalidRegIDsResult, error)

DevTools APIs

  • GetAliasesOfRegID(regID string) (*AliasesOfRegIDResult, error)
  • GetTopicsOfRegID(regID string) (*TopicsOfRegIDResult, error)

xiaomi-push's People

Contributors

yilee avatar

Stargazers

coder-user avatar orlandoXu avatar  avatar  avatar  avatar skyasker avatar dewyze avatar  avatar 盖小盖 avatar  avatar GOD avatar Cc avatar  avatar lazyou avatar minjieh avatar Daniel avatar fnsoxt avatar NATA avatar  avatar aichy avatar vimcoder avatar Roshan avatar zhouhaibing avatar 鱼の乐 avatar Larry Zhao avatar WarGot avatar Timothy Zhang avatar 周映 avatar Levent Sagiroglu avatar  avatar  avatar  avatar Dongft avatar Xinyu Liu avatar Justin Lu avatar  avatar Murphy233 avatar Gavin YANG avatar jackluo avatar mail2fish avatar Jet avatar

Watchers

 avatar WarGot avatar songliwei avatar Dongft avatar

xiaomi-push's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.