项目作者: lukabratos

项目描述 :
Pusher Beams Rust Server SDK
高级语言: Rust
项目地址: git://github.com/lukabratos/push-notifications-rust.git
创建时间: 2018-07-10T18:09:17Z
项目社区:https://github.com/lukabratos/push-notifications-rust

开源协议:

下载


Pusher Beams Rust Server SDK

Build Status

  1. [dependencies]
  2. beams = "0.1.0"

Usage

  1. extern crate beams;
  2. use beams::publish;
  3. pub fn main() {
  4. let interests = vec![String::from("pizza"), String::from("avocado")];
  5. let publish_request = r#"{
  6. "apns": {
  7. "aps": {
  8. "alert": "Hello!"
  9. }
  10. },
  11. "fcm": {
  12. "notification": {
  13. "title": "Hello!",
  14. "body": "Hello, world!"
  15. }
  16. }
  17. }"#;
  18. publish(
  19. String::from("id"),
  20. String::from("key"),
  21. interests,
  22. publish_request,
  23. );
  24. }