apnotic 1.5.0 → 1.6.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/lib/apnotic/abstract_notification.rb +4 -0
- data/lib/apnotic/connection.rb +1 -1
- data/lib/apnotic/notification.rb +4 -0
- data/lib/apnotic/request.rb +1 -0
- data/lib/apnotic/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: 3a12bf6562f526094bfb25d069691960ef05370f
|
4
|
+
data.tar.gz: ede34b1b59fa3a3b70f9a540dd5203d7580f153b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5ada23d1bf049ad7c2c743b3cf3b4f17ac0d905bb26a141d4410840f82c86392dacc8421a411de936ca5078c01b7598ce175e5c968c908f3244ac198c46a7da
|
7
|
+
data.tar.gz: 146444d6cd99bff426bf51b76980fdf0957a5ee160ec16409bcd9d52fc8742b40f43ba2545baeb43594e797c299d5da9b48de6159d87055c580797eefd37979c
|
data/lib/apnotic/connection.rb
CHANGED
@@ -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
|
-
|
104
|
+
1
|
105
105
|
else
|
106
106
|
@client.remote_settings[:settings_max_concurrent_streams]
|
107
107
|
end
|
data/lib/apnotic/notification.rb
CHANGED
@@ -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
|
data/lib/apnotic/request.rb
CHANGED
@@ -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
|
data/lib/apnotic/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2019-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-http2
|