apns-persistent 0.1.3 → 1.0.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 +5 -5
- data/apns-persistent.gemspec +2 -2
- data/lib/apns/persistent/push_client.rb +8 -5
- data/lib/apns/persistent/version.rb +1 -1
- metadata +11 -13
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 | 
            -
             | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 2 | 
            +
            SHA256:
         | 
| 3 | 
            +
              metadata.gz: 7158adcb99cf9bf05bbdc7773ea866985dcacff58efd53296fdae3613597c452
         | 
| 4 | 
            +
              data.tar.gz: b9eb55de627fa44a56ea9072d6ed9c52f6c8ac7e7f65bda04af0e4e173c80cd3
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: df466dd1047f0c7554c250873c2673d2b7a9acfe84ba587a60cdd5f49043fb9585154d27c2afa85a631106e906c35baaac3ed1965fea4f42b51241daef99878f
         | 
| 7 | 
            +
              data.tar.gz: f9addcc059904063f004fbf92e0b0ee4e1380048cabf1b88a9fb508a78c0de91044eb4496d7dc9594bc6df65a61812f66f69d78dec8a3e59125ab7de547ad565
         | 
    
        data/apns-persistent.gemspec
    CHANGED
    
    | @@ -21,7 +21,7 @@ Gem::Specification.new do |spec| | |
| 21 21 |  | 
| 22 22 | 
             
              spec.required_ruby_version = '>= 2.1.0'
         | 
| 23 23 |  | 
| 24 | 
            -
              spec.add_development_dependency "bundler" | 
| 25 | 
            -
              spec.add_development_dependency "rake" | 
| 24 | 
            +
              spec.add_development_dependency "bundler"
         | 
| 25 | 
            +
              spec.add_development_dependency "rake"
         | 
| 26 26 | 
             
              spec.add_development_dependency "rspec"
         | 
| 27 27 | 
             
            end
         | 
| @@ -6,13 +6,13 @@ module Apns | |
| 6 6 | 
             
                  def self.push_once(certificate: ,
         | 
| 7 7 | 
             
                                     passphrase: nil,
         | 
| 8 8 | 
             
                                     sandbox: true,
         | 
| 9 | 
            -
             | 
| 10 9 | 
             
                                     token: ,
         | 
| 11 10 | 
             
                                     alert: nil,
         | 
| 12 11 | 
             
                                     badge: nil,
         | 
| 13 12 | 
             
                                     sound: nil,
         | 
| 14 13 | 
             
                                     category: nil,
         | 
| 15 14 | 
             
                                     content_available: true,
         | 
| 15 | 
            +
                                     mutable_content: false,
         | 
| 16 16 | 
             
                                     custom_payload: nil,
         | 
| 17 17 | 
             
                                     id: nil,
         | 
| 18 18 | 
             
                                     expiry: nil,
         | 
| @@ -27,6 +27,7 @@ module Apns | |
| 27 27 | 
             
                                sound: sound,
         | 
| 28 28 | 
             
                                category: category,
         | 
| 29 29 | 
             
                                content_available: content_available,
         | 
| 30 | 
            +
                                mutable_content: mutable_content,
         | 
| 30 31 | 
             
                                custom_payload: custom_payload,
         | 
| 31 32 | 
             
                                id: id,
         | 
| 32 33 | 
             
                                expiry: expiry,
         | 
| @@ -45,6 +46,7 @@ module Apns | |
| 45 46 | 
             
                           sound: nil,
         | 
| 46 47 | 
             
                           category: nil,
         | 
| 47 48 | 
             
                           content_available: true,
         | 
| 49 | 
            +
                           mutable_content: false,
         | 
| 48 50 | 
             
                           custom_payload: nil,
         | 
| 49 51 | 
             
                           id: nil,
         | 
| 50 52 | 
             
                           expiry: nil,
         | 
| @@ -52,7 +54,7 @@ module Apns | |
| 52 54 |  | 
| 53 55 | 
             
                    raise 'please open' if closed?
         | 
| 54 56 |  | 
| 55 | 
            -
                    m = PushClient.message(token, alert, badge, sound, category, content_available, custom_payload, id, expiry, priority)
         | 
| 57 | 
            +
                    m = PushClient.message(token, alert, badge, sound, category, content_available, mutable_content, custom_payload, id, expiry, priority)
         | 
| 56 58 | 
             
                    @connection.write(m)
         | 
| 57 59 |  | 
| 58 60 | 
             
                    if block_given? && @connection.readable?
         | 
| @@ -79,9 +81,9 @@ module Apns | |
| 79 81 | 
             
                      sandbox ? "apn://gateway.sandbox.push.apple.com:2195" : "apn://gateway.push.apple.com:2195"
         | 
| 80 82 | 
             
                    end
         | 
| 81 83 |  | 
| 82 | 
            -
                    def message(token, alert, badge, sound, category, content_available, custom_payload, id, expiry, priority)
         | 
| 84 | 
            +
                    def message(token, alert, badge, sound, category, content_available, mutable_content, custom_payload, id, expiry, priority)
         | 
| 83 85 | 
             
                      data = [token_data(token),
         | 
| 84 | 
            -
                              payload_data(custom_payload, alert, badge, sound, category, content_available),
         | 
| 86 | 
            +
                              payload_data(custom_payload, alert, badge, sound, category, content_available, mutable_content),
         | 
| 85 87 | 
             
                              id_data(id),
         | 
| 86 88 | 
             
                              expiration_data(expiry),
         | 
| 87 89 | 
             
                              priority_data(priority)].compact.join
         | 
| @@ -94,7 +96,7 @@ module Apns | |
| 94 96 | 
             
                      [1, 32, token.gsub(/[<\s>]/, '')].pack('cnH64')
         | 
| 95 97 | 
             
                    end
         | 
| 96 98 |  | 
| 97 | 
            -
                    def payload_data(custom_payload, alert, badge, sound, category, content_available)
         | 
| 99 | 
            +
                    def payload_data(custom_payload, alert, badge, sound, category, content_available, mutable_content)
         | 
| 98 100 | 
             
                      payload = {}.merge(custom_payload || {}).inject({}){|h,(k,v)| h[k.to_s] = v; h}
         | 
| 99 101 |  | 
| 100 102 | 
             
                      payload['aps'] ||= {}
         | 
| @@ -103,6 +105,7 @@ module Apns | |
| 103 105 | 
             
                      payload['aps']['sound'] = sound if sound
         | 
| 104 106 | 
             
                      payload['aps']['category'] = category if category
         | 
| 105 107 | 
             
                      payload['aps']['content-available'] = 1 if content_available
         | 
| 108 | 
            +
                      payload['aps']['mutable-content'] = 1 if mutable_content
         | 
| 106 109 |  | 
| 107 110 | 
             
                      json = payload.to_json
         | 
| 108 111 | 
             
                      [2, json.bytes.count, json].pack('cna*')
         | 
    
        metadata
    CHANGED
    
    | @@ -1,43 +1,43 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: apns-persistent
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0. | 
| 4 | 
            +
              version: 1.0.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - malt03
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: exe
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date:  | 
| 11 | 
            +
            date: 2019-05-17 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| 15 15 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 16 16 | 
             
                requirements:
         | 
| 17 | 
            -
                - - " | 
| 17 | 
            +
                - - ">="
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: ' | 
| 19 | 
            +
                    version: '0'
         | 
| 20 20 | 
             
              type: :development
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 | 
            -
                - - " | 
| 24 | 
            +
                - - ">="
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: ' | 
| 26 | 
            +
                    version: '0'
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: rake
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 30 30 | 
             
                requirements:
         | 
| 31 | 
            -
                - - " | 
| 31 | 
            +
                - - ">="
         | 
| 32 32 | 
             
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            -
                    version: ' | 
| 33 | 
            +
                    version: '0'
         | 
| 34 34 | 
             
              type: :development
         | 
| 35 35 | 
             
              prerelease: false
         | 
| 36 36 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 37 | 
             
                requirements:
         | 
| 38 | 
            -
                - - " | 
| 38 | 
            +
                - - ">="
         | 
| 39 39 | 
             
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            -
                    version: ' | 
| 40 | 
            +
                    version: '0'
         | 
| 41 41 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 42 42 | 
             
              name: rspec
         | 
| 43 43 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -101,10 +101,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 101 101 | 
             
                - !ruby/object:Gem::Version
         | 
| 102 102 | 
             
                  version: '0'
         | 
| 103 103 | 
             
            requirements: []
         | 
| 104 | 
            -
             | 
| 105 | 
            -
            rubygems_version: 2.4.5
         | 
| 104 | 
            +
            rubygems_version: 3.0.1
         | 
| 106 105 | 
             
            signing_key: 
         | 
| 107 106 | 
             
            specification_version: 4
         | 
| 108 107 | 
             
            summary: Send Apple Push Notifications
         | 
| 109 108 | 
             
            test_files: []
         | 
| 110 | 
            -
            has_rdoc: 
         |