localytics-ruby 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/localytics/push.rb +10 -10
- data/test/localytics_test.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NmIwOGM4M2JiN2RmYzEyNGIwNDIyMDljNThjMTcwNDM0MzY1ZTdmYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDMxYmQzZjgwZmEwYzNkOWRjODlmNTRlZDRhMDRmN2QyOGVhM2QzZQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjgwZjM5MzAyNDM4OGIxYjBhMjZlMGU1ZDA2YzEzNzFiNjlmNGMyYjE2MmI2
|
10
|
+
MjlhMTVjNDRlZTM3NmNlOWExMWJmZjA4MDliY2I3Y2Q3OGFlYWFjMTUyZmE5
|
11
|
+
MTU5ZDAyOTdkZDVkNDEyYzFhMTJjMTViYjg3MGQwOWExYWUyOTU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWE0ZWM4MDA2YzQ1Y2Y4MjEzNWU2Y2E2YzFlMWE0ZmU5MzM2NDBkOGM1NDk0
|
14
|
+
MWY1ZGMyY2Q4MTU0NWJkMjY5Y2I4OTJmZWJhMzBhZDJlYzNhY2UzZTczM2Vj
|
15
|
+
MDI4MmYwOGY3ODRjZDRjOGY2MWVmNjY0ODIxMGI2M2UxMzk0OWY=
|
data/lib/localytics/push.rb
CHANGED
@@ -22,7 +22,7 @@ module Localytics
|
|
22
22
|
#
|
23
23
|
# More information on how messages can be built can be found on
|
24
24
|
# http://docs.localytics.com/#Dev/getting-started-trans-push.html
|
25
|
-
def self.push(messages, target_type, app_id=nil, api_key=nil, api_secret=nil, headers={})
|
25
|
+
def self.push(messages, target_type, app_id, campaing_key = nil, api_key=nil, api_secret=nil, headers={})
|
26
26
|
Localytics.request(
|
27
27
|
api_base(app_id),
|
28
28
|
:post,
|
@@ -32,7 +32,7 @@ module Localytics
|
|
32
32
|
{
|
33
33
|
messages: messages,
|
34
34
|
target_type: target_type,
|
35
|
-
campaign_key:
|
35
|
+
campaign_key: campaing_key,
|
36
36
|
request_id: SecureRandom.uuid
|
37
37
|
},
|
38
38
|
headers
|
@@ -40,22 +40,22 @@ module Localytics
|
|
40
40
|
end
|
41
41
|
|
42
42
|
# For :messages options please check the :push method
|
43
|
-
def self.push_to_customers(messages, app_id, api_key=nil, api_secret=nil)
|
44
|
-
push messages, 'customer_id', app_id, api_key, api_secret
|
43
|
+
def self.push_to_customers(messages, app_id, campaing_key = nil, api_key=nil, api_secret=nil)
|
44
|
+
push messages, 'customer_id', campaing_key, app_id, api_key, api_secret
|
45
45
|
end
|
46
46
|
|
47
47
|
# For :messages options please check the :push method
|
48
|
-
def self.push_to_all_customers(messages, app_id, api_key=nil, api_secret=nil)
|
49
|
-
push messages, 'broadcast', app_id, api_key, api_secret
|
48
|
+
def self.push_to_all_customers(messages, app_id, campaing_key = nil, api_key=nil, api_secret=nil)
|
49
|
+
push messages, 'broadcast', campaing_key, app_id, api_key, api_secret
|
50
50
|
end
|
51
51
|
|
52
52
|
# For :messages options please check the :push method
|
53
|
-
def self.push_to_profiles(messages, app_id, api_key=nil, api_secret=nil)
|
54
|
-
push messages, 'profile', app_id, api_key, api_secret
|
53
|
+
def self.push_to_profiles(messages, app_id, campaing_key = nil, api_key=nil, api_secret=nil)
|
54
|
+
push messages, 'profile', campaing_key, app_id, api_key, api_secret
|
55
55
|
end
|
56
56
|
|
57
|
-
def self.push_to_audiences(messages, app_id, api_key=nil, api_secret=nil)
|
58
|
-
push messages, 'audience_id', app_id, api_key, api_secret
|
57
|
+
def self.push_to_audiences(messages, app_id, campaing_key = nil, api_key=nil, api_secret=nil)
|
58
|
+
push messages, 'audience_id', campaing_key, app_id, api_key, api_secret
|
59
59
|
end
|
60
60
|
|
61
61
|
private
|
data/test/localytics_test.rb
CHANGED
@@ -68,6 +68,6 @@ end
|
|
68
68
|
|
69
69
|
test 'send push' do |mock|
|
70
70
|
mock.expects(:post).once.with('https://messaging.localytics.com/v2/push/app_id', anything).returns(test_response({}, 200))
|
71
|
-
Localytics::Push.push_to_customers [{alert: 'message', target: 1}], 'app_id'
|
71
|
+
Localytics::Push.push_to_customers [{alert: 'message', target: 1}], 'customer_id', 'app_id'
|
72
72
|
end
|
73
73
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: localytics-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobuy development team
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-09-
|
12
|
+
date: 2015-09-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- - ~>
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '1.1'
|
56
|
-
description: API to interact with Localytics
|
56
|
+
description: API to interact with Localytics https://localytics.com/
|
57
57
|
email:
|
58
58
|
- support@tob.uy
|
59
59
|
executables: []
|
@@ -66,7 +66,7 @@ files:
|
|
66
66
|
- lib/localytics/push.rb
|
67
67
|
- test/localytics_test.rb
|
68
68
|
- test/test_helper.rb
|
69
|
-
homepage: https://
|
69
|
+
homepage: https://github.com/tobuy/localytics-ruby
|
70
70
|
licenses:
|
71
71
|
- MIT
|
72
72
|
metadata: {}
|