用户工具

站点工具


这是本文档旧的修订版!


User Menu of PNS

The document introduces usage of PNS Web interface.

Here are the concepts of user channel and tag channel, which must be clarified:

  • user channel is named by the unique uid of mobile device. PNS will sub the uid automatically when the connection is setup (sub means join channel)
  • tag channel is the mobile clients group(uid group) setup by sub API. for instance, a client sub “location:beijing”, then it will join into channel “location:beijing”, when push messages to “location:beijing”, the clients in group of “location:beijing” will receive messages. Tag channel can be treated as a group for tag push.

Invoking the Web interface

Developers need to POST data to Web interface, and the Web interface will return result in JSON.

If the following is configured in the file of toaster.conf:

[web]
bind localhost:8080

Then you can call Web Interface using the following Linux command, or call it by programming of HTTP:

curl –X POST –d POST_DATA http://localhost:8080/METHOD_NAME

inside

POST_DATA is POST data to PNS
METHOD_NAME is the method name to be called

Push to a single user or multiple users(pub)

METHOD_NAME: pub

POST_DATA:

"expired": "1403521931",
             "appid": "XXX",
             "channel": "xxx@qq.com",
             "channel": "xxx@gmail.com",
             "data": "hello world" 

Push to specified one or more tag channels (tagpub)

Push to all the users of an APP (allpub)

Add uid to tag-channel (sub-tag)

Remove uid form tag-channel(unsub-tag)

Push task query (message)

User channel query (userchannel)

Tag channel query (tagchannel)

APP query(app-size)

en/toaster/user-menu-of-pns.1426832144.txt.gz · 最后更改: 2017/07/14 11:12 (外部编辑)