google-api-fcm 0.1.3 → 0.1.4

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: de462d71bfc2bb275f6a41f651a1144d075f51ba
4
- data.tar.gz: de2e5141a1cef3e11410870656f077a52d195c4b
3
+ metadata.gz: 2c6a1d842132268e3eb44bb8475512873fe7f151
4
+ data.tar.gz: e28af7f2fbaadf3b223690f19a970e9b6b767dbe
5
5
  SHA512:
6
- metadata.gz: 81ee3760665a8264b509c8952ea571f8484e8d1d9c4209cf0ca354df799f8f2f9c592eed7fd46c00c77fb7dfb93dd7b5d58ac87c83a2980ef5c4bdcb1399a258
7
- data.tar.gz: 47c79942eeb959d85564b4bec8c5f200ee9e960be1023eea37d89d481db728e2c9321fef149d439772aeba90c87609893bf0de836d6da69c7588477f127d4895
6
+ metadata.gz: 553fc815f38b5c79dfb1206588cca59f04e2fc0a10c61bc43282cc29e8fb9e65671131b7e2c5d989b8b260dfb2629b182fbe6a4747ad135003316a56a88df586
7
+ data.tar.gz: 7217fa269b59a6c7ce2668782acef996cf7b3c4b3e52bdff3c2be3c0fe56c4a766c6df87a0eca2cce58a4620974928caa7f7cc74c85e58b718dd96785dbf5939
@@ -28,6 +28,10 @@ module Google
28
28
  command.request_representation = Google::Apis::Messages::Message::Representation
29
29
  command.request_object = message
30
30
 
31
+ if ENV['FIREBASE_DEBUG'].present?
32
+ log_json(command)
33
+ end
34
+
31
35
  execute_or_queue_command(command, &block)
32
36
  end
33
37
 
@@ -36,6 +40,19 @@ module Google
36
40
  def apply_command_defaults(command)
37
41
  command.params['projectId'] = project_id
38
42
  end
43
+
44
+ def log_json(command)
45
+ json = command.request_representation.new(command.request_object)
46
+ .to_json(user_options: { skip_undefined: true })
47
+ json_hash = JSON.parse(json)
48
+ log_message = "About to send json: \n #{pp json_hash}"
49
+
50
+ if defined?(Rails)
51
+ Rails.logger.debug log_message
52
+ else
53
+ puts log_message
54
+ end
55
+ end
39
56
  end
40
57
  end
41
58
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-api-fcm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ilya Krigouzov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-17 00:00:00.000000000 Z
11
+ date: 2018-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-api-client