pushofy 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -12
- data/lib/pushofy/push.rb +0 -2
- data/lib/pushofy/version.rb +1 -1
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5edbb06c89e07debbd874978044645f9209d89ae
|
4
|
+
data.tar.gz: a9eaf55a0bbe9d0ec31ba7764f4cef52d88f773a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33a1ba45c694128a1878eb2860de2b8ea23d9e4380d1e133808b8f43442b58920b9d414a4cdcf773a7304073a3f242b43ab777ab290b63d87e798196584d7622
|
7
|
+
data.tar.gz: 4165725c93e8ba9bf852913ecf94e2d519dc97bd12d69113122303db20d443b3b2c0af4ca6e61ce91dfe832645ef389ca273c3a85fe18f33c94209ab2ec13c68
|
data/README.md
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
# Pushify
|
2
2
|
|
3
|
-
This gem has support for both APNS(sending push notifications to iOS devices) and also GCM(sending push notifications to Android Devices). This gem was extracted out from the push notification server I built for IdleCampus.
|
3
|
+
This gem has support for both APNS(sending push notifications to iOS devices) and also GCM(sending push notifications to Android Devices). This gem was extracted out from the push notification server I built for IdleCampus.
|
4
4
|
|
5
|
-
The basic idea behind this gem is that each device has a unique device id.
|
5
|
+
The basic idea behind this gem is that each device has a unique device id.
|
6
6
|
So when the user starts his app, you send the device id along with the device type and the device token(APNS) or Registeration id(GCM) to http://developer.idlecampus.com server and within your own app you save the user along with the device id.
|
7
7
|
|
8
|
-
For example Ankur is saved to the application server database with a device id 12345485459 and in the push notification server his details get saved as
|
8
|
+
For example Ankur is saved to the application server database with a device id 12345485459 and in the push notification server his details get saved as
|
9
9
|
```
|
10
10
|
device_id:12345485459, device_type:Android, device_token:sdhbfdsfbdjkbkjfbdksljbfdskjbfs.
|
11
11
|
```
|
12
12
|
|
13
|
-
So when you want to send a notification to particular user, you only call something like
|
13
|
+
So when you want to send a notification to particular user, you only call something like
|
14
14
|
```
|
15
15
|
uri = URI('http://developer.idlecampus.com/push/push1')
|
16
16
|
headers = { 'Content-Type' => 'application/json' }
|
17
17
|
http = Net::HTTP.new(uri.host, uri.port)
|
18
18
|
resp, _ = http.post(uri.path, hash.to_json, headers)
|
19
19
|
```
|
20
|
-
|
20
|
+
|
21
21
|
where hash is
|
22
22
|
```ruby
|
23
23
|
entries_hash = {}
|
@@ -25,16 +25,16 @@ entries_hash['devices'] = devices
|
|
25
25
|
entries_hash['message'] = @message
|
26
26
|
entries_hash['app'] = @app
|
27
27
|
entries_hash['from'] = @from
|
28
|
-
timetable_hash['push'] = entries_hash
|
28
|
+
timetable_hash['push'] = entries_hash
|
29
29
|
```
|
30
|
-
|
30
|
+
|
31
31
|
where devices are all the unique ids you get from the database.
|
32
32
|
|
33
33
|
You can also use the website http://developer.idlecampus.com to store your certificate for you in case of APNS and the register id in case of GCM. You only have to go and create an account for yourself.
|
34
34
|
|
35
35
|
Use this gem for sending push to iOS devices and Android Devices just by uploading your certificate to http://developer.idlecampus.com and registering your devices for each user on it.
|
36
36
|
|
37
|
-
Below you will also find the iOS code and Android Code you can use in your mobile applications if you wish to leave handling the push notifications and the ceritfications to us.
|
37
|
+
Below you will also find the iOS code and Android Code you can use in your mobile applications if you wish to leave handling the push notifications and the ceritfications to us.
|
38
38
|
|
39
39
|
Feel free to fork the code to contribute to the project as shown at the bottom of this file.
|
40
40
|
|
@@ -90,15 +90,15 @@ Copy the code below in your AppDelegate.m file and also upload your certificate
|
|
90
90
|
|
91
91
|
### Android
|
92
92
|
|
93
|
-
Use the code below to send your device id to http://developer.idlecampus.com.
|
93
|
+
Use the code below to send your device id to http://developer.idlecampus.com.
|
94
94
|
|
95
95
|
String serverUrl = "http://developer.idlecampus.com/devices";
|
96
96
|
Log.i("idlecampus",serverUrl);
|
97
97
|
Map<String, String> params = new HashMap<String, String>();
|
98
98
|
params.put("registration_id", regId);
|
99
|
-
|
99
|
+
|
100
100
|
String device_identifier = Settings.Secure.getString(getBaseContext().getContentResolver(), Settings.Secure.ANDROID_ID);
|
101
|
-
|
101
|
+
|
102
102
|
params.put("device_identifier",device_identifier);
|
103
103
|
params.put("device_type","Android");
|
104
104
|
|
@@ -154,7 +154,7 @@ Use the code below to send your device id to http://developer.idlecampus.com.
|
|
154
154
|
|
155
155
|
|
156
156
|
but if you want to design an app to send a push to user then register users along with their device ids
|
157
|
-
|
157
|
+
|
158
158
|
### Apple
|
159
159
|
|
160
160
|
NSString *cuser = [NSString stringWithCString:user.c_str()
|
data/lib/pushofy/push.rb
CHANGED
data/lib/pushofy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pushofy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ankur Kothari
|
@@ -14,56 +14,56 @@ dependencies:
|
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: dotenv
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - '>='
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: Send push notifications to Android and iOS devices by maping the device
|
@@ -75,8 +75,8 @@ executables:
|
|
75
75
|
extensions: []
|
76
76
|
extra_rdoc_files: []
|
77
77
|
files:
|
78
|
-
-
|
79
|
-
-
|
78
|
+
- .gitignore
|
79
|
+
- .rspec
|
80
80
|
- CertificateName.pem
|
81
81
|
- DevCert.pem
|
82
82
|
- Gemfile
|
@@ -112,17 +112,17 @@ require_paths:
|
|
112
112
|
- lib
|
113
113
|
required_ruby_version: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - '>='
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0'
|
118
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
119
119
|
requirements:
|
120
|
-
- -
|
120
|
+
- - '>='
|
121
121
|
- !ruby/object:Gem::Version
|
122
122
|
version: '0'
|
123
123
|
requirements: []
|
124
124
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.
|
125
|
+
rubygems_version: 2.4.1
|
126
126
|
signing_key:
|
127
127
|
specification_version: 4
|
128
128
|
summary: Sending push notifications to Android and iOS devices.
|