コード例 #1
0
        public void 푸시테스트()
        {
            WorksPusher pusher = null;

            string apiId      = "APIID";
            string serverid   = "SERVERID";
            string privatekey = "개인키";
            // 서버 ID / 발급받은 개인키로 token 발급 받아야함
            string token_domain = "https://auth.worksmobile.com/b";
            string token_url    = "server/token";
            // 발급받은 토큰으로 푸시
            string consumerkey = "CONSUMERKEY";
            string push_domain = "https://apis.worksmobile.com";
            string push_url    = "message/sendMessage/v2";
            int    botno       = 0000;

            // 푸시 내용
            string receiveuseriD = "RECEIVE";
            string pushmessage   = "보낼 푸시 메세지";

            //기본 설정
            pusher          = new WorksPusher(apiId, serverid, privatekey, push_domain, push_url, token_domain, token_url, consumerkey, botno);
            pusher.Success += pushSuccess;
            pusher.Fail    += pushFail;
            pusher.Push(receiveuseriD, pushmessage);

            Thread.Sleep(1000);
        }
コード例 #2
0
ファイル: FrmWorksPusher.cs プロジェクト: parkjoohwan/MyLib
        public FrmWorksPusher()
        {
            InitializeComponent();

            string apiId      = "APIID";
            string serverid   = "SERVERID";
            string privatekey = "개인키";
            // 서버 ID / 발급받은 개인키로 token 발급 받아야함
            string token_domain = "https://auth.worksmobile.com/b";
            string token_url    = "server/token";
            // 발급받은 토큰으로 푸시
            string consumerkey = "CONSUMERKEY";
            string push_domain = "https://apis.worksmobile.com";
            string push_url    = "message/sendMessage/v2";
            int    botno       = 0000;

            pusher          = new WorksPusher(apiId, serverid, privatekey, push_domain, push_url, token_domain, token_url, consumerkey, botno);
            pusher.Success += pushSuccess;
            pusher.Fail    += pushFail;
        }