1、工具截图:
2、常用的构造Response:
datatype:
1 = 视频
2 = 图集
其他 = 新闻
{
"aps" : { "alert" : "Video" },
"t":"N",
"c":"{\"url\":\"https://staticcds.51y5.net/htdoc/ku6/h5/detail.html?newsId=25~tW_P0DKgp0Jkb-h8y3dfvex5_L4.&ref=tt_i&appId=NEWS02&s=link\",\"param\":\"newsId=25~8GdJ9MZoy46j9k3JQ3Q34_UCdKk.&newstype=1&datatype=1\"}"
}
{
"t":"N",
"c":"{\"url\":\"https://jujiao.sjzdaily.com.cn/wifi/20171219/849427.html?fromId=2304858729218048&newsId=26~2488974945107968&docId=26~2488975043166208\",\"param\":\"newsId=26~2488975043166208&newstype=1\"}",
"aps" : {
"alert" : "新闻标题",
"badge" : 6,
},
}
{
"t":"U",
"c":"https://jujiao.sjzdaily.com.cn/wifi/20171219/849427.html?fromId=2304858729218048&newsId=26~2488974945107968&docId=26~2488975043166208",
"aps" : {
"alert" : "新闻标题",
"badge" : 6,
},
}
{
"t":"U",
"c":"http://m.kankanews.com/n/1_8061815.html?utm_source=Wifikey&ref=tt_a",
"aps" : {
"alert" : "新闻标题",
"badge" : 6,
},
}
使用方法: 1、添加Token
添加的时候他又分了3种情况,其实感觉直接手动输入就行,虽然他不推荐。。
直接在AppDelegate的注册通知方法中获取Token
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken;
2、从开发者网站上下载推送证书,选择添加上去~
3、直接点击连接,会提示访问钥匙串之类,同意~
4、之后就设置推送的内容,比如标题、内容,随便写写~
5、最后就是发送咯~
6、按照步骤来吧,最后断开连接~