c2dm 0.1.5 → 0.1.6
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.
- data/Gemfile.lock +2 -2
- data/README.markdown +27 -23
- data/VERSION +1 -1
- data/c2dm.gemspec +3 -3
- data/lib/c2dm.rb +1 -1
- metadata +4 -4
data/Gemfile.lock
CHANGED
data/README.markdown
CHANGED
@@ -15,37 +15,41 @@ An Android device running 2.2 or newer, its registration token, and a google acc
|
|
15
15
|
There are two ways to use c2dm.
|
16
16
|
|
17
17
|
Sending many notifications:
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
18
|
+
```notifications = [
|
19
|
+
{
|
20
|
+
:registration_id => "...",
|
21
|
+
:data => {
|
22
|
+
:some_message => "Some payload"
|
23
|
+
:another_message => 10
|
24
|
+
},
|
25
|
+
:collapse_key => "foobar" #optional
|
26
|
+
}
|
27
|
+
]
|
28
|
+
|
29
|
+
C2DM.send_notifications("someone@gmail.com", "and_their_password", notifications, "MyCompany-MyApp-1.0.0")```
|
30
30
|
|
31
31
|
...or one at a time:
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
32
|
+
```c2dm = C2DM.new("someone@gmail.com", "and_their_password", "MyCompany-MyApp-1.0")
|
33
|
+
|
34
|
+
notification = {
|
35
|
+
:registration_id => "...",
|
36
|
+
:data => {
|
37
|
+
:some_message => "Some payload",
|
38
|
+
:another_message => 10
|
39
|
+
},
|
40
|
+
:collapse_key => "foobar" #optional
|
41
|
+
}
|
42
42
|
|
43
|
-
|
43
|
+
c2dm.send_notification(notification)```
|
44
44
|
|
45
45
|
##Copyrights
|
46
46
|
|
47
47
|
* Copyright (c) 2010-2011 Amro Mousa, Shawn Veader. See LICENSE.txt for details.
|
48
48
|
|
49
|
+
##Thanks
|
50
|
+
|
51
|
+
* [Paul Chun](https://github.com/sixofhearts)
|
52
|
+
|
49
53
|
##Other stuff
|
50
54
|
|
51
55
|
You might want to checkout GroupMe's fork of this gem as well.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/c2dm.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{c2dm}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Amro Mousa"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-06-23}
|
13
13
|
s.description = %q{c2dm sends push notifications to Android devices via google c2dm.}
|
14
14
|
s.email = %q{amromousa@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
|
|
32
32
|
s.homepage = %q{http://github.com/amro/c2dm}
|
33
33
|
s.licenses = ["MIT"]
|
34
34
|
s.require_paths = ["lib"]
|
35
|
-
s.rubygems_version = %q{1.
|
35
|
+
s.rubygems_version = %q{1.6.2}
|
36
36
|
s.summary = %q{c2dm sends push notifications to Android devices via google c2dm.}
|
37
37
|
s.test_files = [
|
38
38
|
"test/helper.rb",
|
data/lib/c2dm.rb
CHANGED
@@ -44,7 +44,7 @@ class C2DM
|
|
44
44
|
response = self.class.post(AUTH_URL, params)
|
45
45
|
|
46
46
|
# check for authentication failures
|
47
|
-
raise response if response['Error=']
|
47
|
+
raise response.parsed_response if response['Error=']
|
48
48
|
|
49
49
|
@auth_token = response.body.split("\n")[2].gsub('Auth=', '')
|
50
50
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: c2dm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Amro Mousa
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-06-23 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
103
|
requirements:
|
104
104
|
- - ">="
|
105
105
|
- !ruby/object:Gem::Version
|
106
|
-
hash:
|
106
|
+
hash: -2874560584859296799
|
107
107
|
segments:
|
108
108
|
- 0
|
109
109
|
version: "0"
|
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
116
|
requirements: []
|
117
117
|
|
118
118
|
rubyforge_project:
|
119
|
-
rubygems_version: 1.
|
119
|
+
rubygems_version: 1.6.2
|
120
120
|
signing_key:
|
121
121
|
specification_version: 3
|
122
122
|
summary: c2dm sends push notifications to Android devices via google c2dm.
|