极光推送
来源:互联网 发布:手机怎么查看淘宝积分 编辑:程序博客网 时间:2024/05/17 23:34
极光推送
极光推送需要有
- 推送设备对象
- 推送通知内容
- 推送设置
https://github.com/jpush/jpush-api-ruby-client/blob/master/docs/Guides.md#%E6%8E%A8%E9%80%81%E6%B6%88%E6%81%AF
构建 Audience 设备对象
# 链式调用audience = JPush::Push::Audience.new. set_tag(tag). set_tag_and(tag_and). set_tag_not(tag_not). set_alias(alis). set_registration_id(registration_ids)
构建 Notification 通知对象内容
notification = JPush::Push::Notification.new. set_alert(alert). set_android( alert: alert, title: title, builder_id: builder_id, extras: extras ).set_ios( alert: alert, sound: sound, badge: badge, contentavailable: contentavailable, mutablecontent: mutablecontent, category: category, extras: extras )
构建 PushPayload 推送设置
options = { sendno: no, time_to_live: time, override_msg_id: msg_id, apns_production: true, big_push_duration: duration}# 参数 options 仅接受一个 Hash 对象,而这个 Hash 对象的键也仅支持上面所示的5种。pusher = jpush.pusherpush_payload = JPush::Push::PushPayload.new( platform: platform, audience: audience, notification: notification, message: message).set_options(options)# 发送推送pusher.push(push_payload)
阅读全文
0 0
- 极光推送
- 极光推送
- 极光推送
- 极光推送
- 极光推送
- 极光推送
- 极光推送
- 极光推送
- 极光推送
- 极光推送
- 极光推送
- 极光推送
- 极光推送
- 极光推送
- 推送 、极光
- 极光推送
- 极光推送
- 极光推送
- Python 边做边学 8.6 工具类--时间工具(TimeUtil)
- 动态规划——Decode Ways[LeetCode]
- 安装RPM包或者安装源码包
- 在Ubuntu 14.04安装和配置Elasticsearch集群(最新5.5.2版)
- Java知识(泛型)
- 极光推送
- IELTS12 TEST8 allow children to make their own choices on everyday matters
- Scrapy执行crawl命令报错:ModuleNotFoundError: No module named 'win32api'
- POJ 2536 Gopher II(二分图最大匹配)
- hdu 6115 Factory(LCA+暴力)
- 2017 Multi-University Training Contest
- JAVA I-O阶段性小结
- linux进程状态浅析
- 图形处理之Shader语言(二)CG语法篇