umengo 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/README.md +116 -3
 - data/lib/umengo/util.rb +1 -1
 - data/lib/umengo/version.rb +1 -1
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: da164f68aece947fc6c4cd65c5c7e6e4e72edcf9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: b653920c70e3441719ccdb5c9f82bf36308e26a3
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 8ac9a5410487c0d69f81e7d1f30ddc7c3c3eb6b8add8848d8bb10d69b3c0c66e41b0937d8f72fc456d532dadfa592e0d7ca96ddafcd400ffca7c27a91141d73c
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: b1c691793588182d55e428674d47b0eb4a2d2307f6aad519a61f0b79015a34540dff08826e08d6580a75d176677e45db956ecb660d8f357278610e7d619d14cc
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -20,13 +20,126 @@ Or install it yourself as: 
     | 
|
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
            ## Usage
         
     | 
| 
       22 
22 
     | 
    
         | 
| 
       23 
     | 
    
         
            -
             
     | 
| 
      
 23 
     | 
    
         
            +
            - params require  :data, :payload, :body
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            - params optional :extra, :extra, :policy
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            #### Android push params
         
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
      
 29 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 30 
     | 
    
         
            +
                android_params = {
         
     | 
| 
      
 31 
     | 
    
         
            +
                  data: {
         
     | 
| 
      
 32 
     | 
    
         
            +
                    alias_type: "xx",
         
     | 
| 
      
 33 
     | 
    
         
            +
                    alias: "xx",
         
     | 
| 
      
 34 
     | 
    
         
            +
                    file_id: "xx",
         
     | 
| 
      
 35 
     | 
    
         
            +
                    filter: {},
         
     | 
| 
      
 36 
     | 
    
         
            +
                    production_mode: "true/false",
         
     | 
| 
      
 37 
     | 
    
         
            +
                    description: "xx",
         
     | 
| 
      
 38 
     | 
    
         
            +
                    thirdparty_id: "xx"
         
     | 
| 
      
 39 
     | 
    
         
            +
                  },
         
     | 
| 
      
 40 
     | 
    
         
            +
                  payload: {
         
     | 
| 
      
 41 
     | 
    
         
            +
                    display_type: "notifcation/message"
         
     | 
| 
      
 42 
     | 
    
         
            +
                  },
         
     | 
| 
      
 43 
     | 
    
         
            +
                  body: {
         
     | 
| 
      
 44 
     | 
    
         
            +
                    ticker: "xxx",
         
     | 
| 
      
 45 
     | 
    
         
            +
                    title: "xxx",
         
     | 
| 
      
 46 
     | 
    
         
            +
                    text: "content",
         
     | 
| 
      
 47 
     | 
    
         
            +
                    after_open: "xx",
         
     | 
| 
      
 48 
     | 
    
         
            +
                    activity: "xx"
         
     | 
| 
      
 49 
     | 
    
         
            +
                    icon: "xx",
         
     | 
| 
      
 50 
     | 
    
         
            +
                    largeIcon: "xx",
         
     | 
| 
      
 51 
     | 
    
         
            +
                    img: "xx",
         
     | 
| 
      
 52 
     | 
    
         
            +
                    sound: "xx",
         
     | 
| 
      
 53 
     | 
    
         
            +
                    builder_id: "xx",
         
     | 
| 
      
 54 
     | 
    
         
            +
                    play_vibrate: "true/false",
         
     | 
| 
      
 55 
     | 
    
         
            +
                    play_lights:" true/false",
         
     | 
| 
      
 56 
     | 
    
         
            +
                    play_sound: "true/false",
         
     | 
| 
      
 57 
     | 
    
         
            +
                    url: "xx",
         
     | 
| 
      
 58 
     | 
    
         
            +
                    custom: "xx"/{}
         
     | 
| 
      
 59 
     | 
    
         
            +
                  }
         
     | 
| 
      
 60 
     | 
    
         
            +
                  extra: {
         
     | 
| 
      
 61 
     | 
    
         
            +
                    key1: "value1",
         
     | 
| 
      
 62 
     | 
    
         
            +
                  },
         
     | 
| 
      
 63 
     | 
    
         
            +
                  policy: {
         
     | 
| 
      
 64 
     | 
    
         
            +
                    start_time: "xx",
         
     | 
| 
      
 65 
     | 
    
         
            +
                    expire_time: "xx",
         
     | 
| 
      
 66 
     | 
    
         
            +
                    max_send_num: "xx",
         
     | 
| 
      
 67 
     | 
    
         
            +
                    out_biz_no: "xx"
         
     | 
| 
      
 68 
     | 
    
         
            +
                  }
         
     | 
| 
      
 69 
     | 
    
         
            +
                }
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
      
 71 
     | 
    
         
            +
            ```
         
     | 
| 
      
 72 
     | 
    
         
            +
             
     | 
| 
      
 73 
     | 
    
         
            +
            #### Ios push params
         
     | 
| 
      
 74 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 75 
     | 
    
         
            +
                ios_params = {
         
     | 
| 
      
 76 
     | 
    
         
            +
                  data: {
         
     | 
| 
      
 77 
     | 
    
         
            +
                    alias_type: "xx",
         
     | 
| 
      
 78 
     | 
    
         
            +
                    alias: "xx",
         
     | 
| 
      
 79 
     | 
    
         
            +
                    file_id: "xx",
         
     | 
| 
      
 80 
     | 
    
         
            +
                    filter: {},
         
     | 
| 
      
 81 
     | 
    
         
            +
                    production_mode: "false",
         
     | 
| 
      
 82 
     | 
    
         
            +
                    description: "xx",
         
     | 
| 
      
 83 
     | 
    
         
            +
                    thirdparty_id: "xx"
         
     | 
| 
      
 84 
     | 
    
         
            +
                  },
         
     | 
| 
      
 85 
     | 
    
         
            +
                  body: {
         
     | 
| 
      
 86 
     | 
    
         
            +
                    alert: "content",
         
     | 
| 
      
 87 
     | 
    
         
            +
                    badge: "xx",
         
     | 
| 
      
 88 
     | 
    
         
            +
                    sound: "xx",
         
     | 
| 
      
 89 
     | 
    
         
            +
                    "content-available" => "xx",
         
     | 
| 
      
 90 
     | 
    
         
            +
                    category: "xx"
         
     | 
| 
      
 91 
     | 
    
         
            +
                    icon: "xx",
         
     | 
| 
      
 92 
     | 
    
         
            +
                    largeIcon: "xx",
         
     | 
| 
      
 93 
     | 
    
         
            +
                    img: "xx",
         
     | 
| 
      
 94 
     | 
    
         
            +
                    sound: "xx",
         
     | 
| 
      
 95 
     | 
    
         
            +
                    builder_id: "xx",
         
     | 
| 
      
 96 
     | 
    
         
            +
                    play_vibrate: "true/false",
         
     | 
| 
      
 97 
     | 
    
         
            +
                    play_lights:" true/false",
         
     | 
| 
      
 98 
     | 
    
         
            +
                    play_sound: "true/false",
         
     | 
| 
      
 99 
     | 
    
         
            +
                    url: "xx",
         
     | 
| 
      
 100 
     | 
    
         
            +
                    custom: "xx"/{}
         
     | 
| 
      
 101 
     | 
    
         
            +
                  }
         
     | 
| 
      
 102 
     | 
    
         
            +
                  extra: {
         
     | 
| 
      
 103 
     | 
    
         
            +
                    key1: "value1",
         
     | 
| 
      
 104 
     | 
    
         
            +
                  },
         
     | 
| 
      
 105 
     | 
    
         
            +
                  policy: {
         
     | 
| 
      
 106 
     | 
    
         
            +
                    start_time: "xx",
         
     | 
| 
      
 107 
     | 
    
         
            +
                    expire_time: "xx",
         
     | 
| 
      
 108 
     | 
    
         
            +
                    max_send_num: "xx",
         
     | 
| 
      
 109 
     | 
    
         
            +
                    out_biz_no: "xx"
         
     | 
| 
      
 110 
     | 
    
         
            +
                  }
         
     | 
| 
      
 111 
     | 
    
         
            +
                }
         
     | 
| 
      
 112 
     | 
    
         
            +
            ```
         
     | 
| 
      
 113 
     | 
    
         
            +
             
     | 
| 
      
 114 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 115 
     | 
    
         
            +
            plantform = "ios/android"
         
     | 
| 
      
 116 
     | 
    
         
            +
            client = Umengo::Client.new(appkey, app_master_secret, plantform)
         
     | 
| 
      
 117 
     | 
    
         
            +
            ```
         
     | 
| 
      
 118 
     | 
    
         
            +
             
     | 
| 
      
 119 
     | 
    
         
            +
            ##### broadcast
         
     | 
| 
      
 120 
     | 
    
         
            +
            ```
         
     | 
| 
      
 121 
     | 
    
         
            +
            client.broadcast(android_params)
         
     | 
| 
      
 122 
     | 
    
         
            +
            ```
         
     | 
| 
      
 123 
     | 
    
         
            +
             
     | 
| 
      
 124 
     | 
    
         
            +
             
     | 
| 
      
 125 
     | 
    
         
            +
            ##### unicast
         
     | 
| 
      
 126 
     | 
    
         
            +
            ```
         
     | 
| 
      
 127 
     | 
    
         
            +
            client.unicast(device_tokens, android_params)
         
     | 
| 
      
 128 
     | 
    
         
            +
            ```
         
     | 
| 
      
 129 
     | 
    
         
            +
             
     | 
| 
      
 130 
     | 
    
         
            +
            ##### listcast
         
     | 
| 
      
 131 
     | 
    
         
            +
            ```
         
     | 
| 
      
 132 
     | 
    
         
            +
            client.listcast(device_tokens, android_params)
         
     | 
| 
      
 133 
     | 
    
         
            +
            ```
         
     | 
| 
      
 134 
     | 
    
         
            +
             
     | 
| 
       24 
135 
     | 
    
         | 
| 
       25 
136 
     | 
    
         
             
            ## Development
         
     | 
| 
       26 
137 
     | 
    
         | 
| 
       27 
     | 
    
         
            -
             
     | 
| 
      
 138 
     | 
    
         
            +
            ### TODO
         
     | 
| 
       28 
139 
     | 
    
         | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
      
 140 
     | 
    
         
            +
            - Spec tests
         
     | 
| 
      
 141 
     | 
    
         
            +
            - Make the parameters more easily assembled
         
     | 
| 
      
 142 
     | 
    
         
            +
            - ios and android more easily distinguish
         
     | 
| 
       30 
143 
     | 
    
         | 
| 
       31 
144 
     | 
    
         
             
            ## Contributing
         
     | 
| 
       32 
145 
     | 
    
         | 
    
        data/lib/umengo/util.rb
    CHANGED
    
    
    
        data/lib/umengo/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: umengo
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.3.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Jed_Huo
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: exe
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2016-06- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-06-06 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: faraday
         
     |