apnotic 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3c1c1b34ccaa073b424f8e6fe8db70ddae3c99c
4
- data.tar.gz: 12c4efa95b90d630bf2e5b9f325300522f547de0
3
+ metadata.gz: 3a12bf6562f526094bfb25d069691960ef05370f
4
+ data.tar.gz: ede34b1b59fa3a3b70f9a540dd5203d7580f153b
5
5
  SHA512:
6
- metadata.gz: 9ed49505ce1af49c071e9f9d34d7c43fe093af662c350aaf8cfe043eb2e98962632f0aeffdbf04ffc1d46ad6a61fd1044a12236961e0c8f12c45a55e3347bf90
7
- data.tar.gz: 84386deb43b649f570c0a48ae2aec00c270c2c2f3139d3cd8eb2a0b78cc132ff2c9220130c4cc5b4c32fcad926961354dc60543e9e1903f5a3b9f2d3ba1b373d
6
+ metadata.gz: e5ada23d1bf049ad7c2c743b3cf3b4f17ac0d905bb26a141d4410840f82c86392dacc8421a411de936ca5078c01b7598ce175e5c968c908f3244ac198c46a7da
7
+ data.tar.gz: 146444d6cd99bff426bf51b76980fdf0957a5ee160ec16409bcd9d52fc8742b40f43ba2545baeb43594e797c299d5da9b48de6159d87055c580797eefd37979c
@@ -26,6 +26,10 @@ module Apnotic
26
26
  authorization ? "bearer #{authorization}" : nil
27
27
  end
28
28
 
29
+ def background_notification?
30
+ false
31
+ end
32
+
29
33
  private
30
34
 
31
35
  def to_hash
@@ -101,7 +101,7 @@ module Apnotic
101
101
  def remote_max_concurrent_streams
102
102
  # 0x7fffffff is the default value from http-2 gem (2^31)
103
103
  if @client.remote_settings[:settings_max_concurrent_streams] == 0x7fffffff
104
- 0
104
+ 1
105
105
  else
106
106
  @client.remote_settings[:settings_max_concurrent_streams]
107
107
  end
@@ -5,6 +5,10 @@ module Apnotic
5
5
  class Notification < AbstractNotification
6
6
  attr_accessor :alert, :badge, :sound, :content_available, :category, :custom_payload, :url_args, :mutable_content, :thread_id
7
7
 
8
+ def background_notification?
9
+ aps.count == 1 && aps.key?('content-available') && aps['content-available'] == 1
10
+ end
11
+
8
12
  private
9
13
 
10
14
  def aps
@@ -16,6 +16,7 @@ module Apnotic
16
16
  h.merge!('apns-id' => notification.apns_id) if notification.apns_id
17
17
  h.merge!('apns-expiration' => notification.expiration) if notification.expiration
18
18
  h.merge!('apns-priority' => notification.priority) if notification.priority
19
+ h.merge!('apns-push-type' => notification.background_notification? ? 'background' : 'alert' )
19
20
  h.merge!('apns-topic' => notification.topic) if notification.topic
20
21
  h.merge!('apns-collapse-id' => notification.apns_collapse_id) if notification.apns_collapse_id
21
22
  h.merge!('authorization' => notification.authorization_header) if notification.authorization_header
@@ -1,3 +1,3 @@
1
1
  module Apnotic
2
- VERSION = '1.5.0'.freeze
2
+ VERSION = '1.6.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: apnotic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Ostinelli
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-08 00:00:00.000000000 Z
11
+ date: 2019-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-http2