matchbox20 0.3.6 → 0.3.7
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/Readme.markdown +2 -2
- data/lib/matchbox20/version.rb +1 -1
- data/lib/matchbox20.rb +7 -9
- metadata +2 -2
data/Readme.markdown
CHANGED
|
@@ -33,9 +33,9 @@ Put `apn_development.pem` in `config/certs` in your rails app. For production, n
|
|
|
33
33
|
|
|
34
34
|
By default, the development environment will always be used. This makes it easy to test your app in production before your iPhone application is approved and your production certificate is active. You can easily override this by adding this line in an initializer or environment file.
|
|
35
35
|
|
|
36
|
-
Matchbox20.
|
|
36
|
+
Matchbox20.environment = Rails.env.to_sym
|
|
37
37
|
|
|
38
|
-
You can also simply set `Matchbox20.
|
|
38
|
+
You can also simply set `Matchbox20.environment` to `:development` or `:production`. Setting the `Matchbox20.environment` chooses the appropriate certificate in your `certs` folder and Apple push notification server.
|
|
39
39
|
|
|
40
40
|
## Usage
|
|
41
41
|
|
data/lib/matchbox20/version.rb
CHANGED
data/lib/matchbox20.rb
CHANGED
|
@@ -27,22 +27,20 @@ module Matchbox20
|
|
|
27
27
|
@@s = nil
|
|
28
28
|
@@ssl = nil
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def self.apn_enviroment
|
|
33
|
-
@@apn_enviroment
|
|
30
|
+
def self.apn_environment
|
|
31
|
+
@@apn_environment
|
|
34
32
|
end
|
|
35
33
|
|
|
36
34
|
def self.apn_development?
|
|
37
|
-
@@
|
|
35
|
+
@@apn_environment != :production
|
|
38
36
|
end
|
|
39
37
|
|
|
40
38
|
def self.apn_production?
|
|
41
|
-
@@
|
|
39
|
+
@@apn_environment == :production
|
|
42
40
|
end
|
|
43
41
|
|
|
44
|
-
def self.
|
|
45
|
-
@@
|
|
42
|
+
def self.apn_environment= environment
|
|
43
|
+
@@apn_environment = environment.to_sym
|
|
46
44
|
@@apn_host = self.apn_production? ? APN_GATEWAY : APN_SANDBOX_GATEWAY
|
|
47
45
|
@@apn_feedback_host = self.apn_production? ? FEEDBACK_SERVICE : FEEDBACK_SANDBOX_SERVICE
|
|
48
46
|
|
|
@@ -70,7 +68,7 @@ module Matchbox20
|
|
|
70
68
|
return cert
|
|
71
69
|
end
|
|
72
70
|
|
|
73
|
-
self.
|
|
71
|
+
self.apn_environment = :development
|
|
74
72
|
|
|
75
73
|
def send_notification options
|
|
76
74
|
raise "Missing apple push notification certificate" unless @@apn_cert
|