delphi怎么调用极光推送进行消息推送啊求搭救
答案:2 悬赏:30 手机版
解决时间 2021-03-06 08:03
- 提问者网友:皆是孤独
- 2021-03-06 01:27
delphi怎么调用极光推送进行消息推送啊求搭救
最佳答案
- 五星知识达人网友:酒安江南
- 2021-03-06 02:03
HttpClient.HandleRedirects := True;
HttpClient.Request.ContentType := 'application/json';
HttpClient.Request.BasicAuthentication := True;
HttpClient.Request.Authentication := TIdBasicAuthentication.Create;
HttpClient.Request.Authentication.Username := 'appKey';
HttpClient.Request.Authentication.Password := 'masterSecret';
messageStr :='{"platform": "all","audience" : "all","notification" : {"alert" : "Hi, JPush for delphi!","android" : {},"ios" : {"extras" : { "newsid" : 321}}}}';
jsonToSend := TStringStream.Create(messageStr, TEncoding.UTF8);
jsonToSend.Position := 0;
Memo1.Text := HttpClient.Post('https://api.jpush.cn/v3/push', jsonToSend);
HttpClient.Request.ContentType := 'application/json';
HttpClient.Request.BasicAuthentication := True;
HttpClient.Request.Authentication := TIdBasicAuthentication.Create;
HttpClient.Request.Authentication.Username := 'appKey';
HttpClient.Request.Authentication.Password := 'masterSecret';
messageStr :='{"platform": "all","audience" : "all","notification" : {"alert" : "Hi, JPush for delphi!","android" : {},"ios" : {"extras" : { "newsid" : 321}}}}';
jsonToSend := TStringStream.Create(messageStr, TEncoding.UTF8);
jsonToSend.Position := 0;
Memo1.Text := HttpClient.Post('https://api.jpush.cn/v3/push', jsonToSend);
全部回答
- 1楼网友:患得患失的劫
- 2021-03-06 02:15
我不会~~~但还是要微笑~~~:)
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯
正方形一边上任一点到这个正方形两条对角线的 |
阴历怎么看 ? |