|
1 | 1 | import Foundation
|
2 | 2 |
|
3 | 3 | /**
|
4 |
| - An interface to Pusher's native push notification service. |
5 |
| - The service is a pub-sub system for push notifications. |
6 |
| - Notifications are published to "interests". |
7 |
| - Clients (such as this app instance) subscribe to those interests. |
8 |
| - |
9 |
| - A per-app singleton of NativePusher is available via an instance of Pusher. |
10 |
| - Use the Pusher.nativePusher() method to get access to it. |
11 |
| - */ |
| 4 | + An interface to Pusher's native push notification service. |
| 5 | + The service is a pub-sub system for push notifications. |
| 6 | + Notifications are published to "interests". |
| 7 | + Clients (such as this app instance) subscribe to those interests. |
| 8 | + |
| 9 | + A per-app singleton of NativePusher is available via an instance of Pusher. |
| 10 | + Use the Pusher.nativePusher() method to get access to it. |
| 11 | +*/ |
12 | 12 | public class NativePusher {
|
13 | 13 | static let sharedInstance = NativePusher()
|
14 | 14 |
|
@@ -39,10 +39,10 @@ public class NativePusher {
|
39 | 39 | }
|
40 | 40 |
|
41 | 41 | /**
|
42 |
| - Registers this app instance with Pusher for push notifications. |
43 |
| - This must be done before we can subscribe to interests. |
44 |
| - Registration happens asynchronously; any errors are reported by print statements. |
45 |
| - */ |
| 42 | + Registers this app instance with Pusher for push notifications. |
| 43 | + This must be done before we can subscribe to interests. |
| 44 | + Registration happens asynchronously; any errors are reported by print statements. |
| 45 | + */ |
46 | 46 | public func register(deviceToken : NSData) {
|
47 | 47 | let request = NSMutableURLRequest(URL: NSURL(string: CLIENT_API_V1_ENDPOINT + "/clients")!)
|
48 | 48 | request.HTTPMethod = "POST"
|
@@ -101,16 +101,16 @@ public class NativePusher {
|
101 | 101 | }
|
102 | 102 |
|
103 | 103 | /**
|
104 |
| - Subscribe to an interest with Pusher's Push Notification Service |
105 |
| - */ |
| 104 | + Subscribe to an interest with Pusher's Push Notification Service |
| 105 | + */ |
106 | 106 | public func subscribe(interestName: String) {
|
107 | 107 | outbox.append(interestName, SubscriptionChange.Subscribe)
|
108 | 108 | tryFlushOutbox()
|
109 | 109 | }
|
110 | 110 |
|
111 | 111 | /**
|
112 |
| - Unsubscribe from an interest with Pusher's Push Notification Service |
113 |
| - */ |
| 112 | + Unsubscribe from an interest with Pusher's Push Notification Service |
| 113 | + */ |
114 | 114 | public func unsubscribe(interestName: String) {
|
115 | 115 | outbox.append(interestName, SubscriptionChange.Unsubscribe)
|
116 | 116 | tryFlushOutbox()
|
|
0 commit comments