Giter VIP home page Giter VIP logo

baidupush-server-sdk's Introduction

BaiduPush Server SDK

百度云推送服务端接口的 java 实现

使用方法:

import cn.oopsware.baidupush.*;

public class test {

	private final static String USERID = "xxxxxxxxxxxxx";
	private final static String CHANNELID = "xxxxxxxxxxxxxxxxxxx";
	
	private final static String API_KEY = "xxxxxxxxxxxxxxxxxxxxxxxx";
	private final static String SECRIT_KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
	
	public static void main(String[] args) {
		BaiduPush baiduPush = new BaiduPush(BaiduPush.HTTP_METHOD_POST, SECRIT_KEY, API_KEY);
		
		//System.out.format("PUSH: %s\n", baiduPush.QueryBindlist(USERID, CHANNELID));
		//System.out.format("PUSH: %s\n", baiduPush.VerifyBind(USERID, null));
		
		//System.out.format("PUSH: %s\n", baiduPush.SetTag("tag1"));
		//System.out.format("PUSH: %s\n", baiduPush.SetTag("tag2"));
		//System.out.format("PUSH: %s\n", baiduPush.SetTag("tag3"));
		
		//System.out.format("PUSH: %s\n", baiduPush.QueryUserTag(USERID));
		//System.out.format("PUSH: %s\n", baiduPush.FetchTag());
		
		System.out.format("PUSH: %s\n", baiduPush.PushMessage("hello world"));
		//System.out.format("PUSH: %s\n", baiduPush.PushMessage("hello world", USERID));
		//System.out.format("PUSH: %s\n", baiduPush.PushTagMessage("hello", "tag1"));
		
		//System.out.format("PUSH: %s\n", baiduPush.PushNotify("Hello", "hello world", USERID));
				
	}

}
  • 官方SDK会在近期开放,请关注官方 服务器SDK
  • 使用透传 PushMessage() 发送 json 内容时会返回错误,请将双引号改为单引号。
  • 发送通知 PushNotify() 尚不完善,需要根据自己需要修改,格式参考
  • 目前功能是对 《REST API》 的简单封装,细节功能以官方文档为准。

baidupush-server-sdk's People

Contributors

oopsware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

baidupush-server-sdk's Issues

URL的编解码存在问题

如下内容的消息发透传消息失败:
{"id":9,"type":9,"title":"A","content":"花花太花花开始关注你的了。"}

如果把消息内容稍加修改(去掉最后的})就可以发送成功:
{"id":9,"type":9,"title":"A","content":"花花太花花开始关注你的了。"

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.