You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tryawait apns.send(notification, pushType: .alert, to: deviceToken)
55
54
tryawait httpClient.shutdown()
56
-
try! group.syncShutdownGracefully()
57
55
exit(0)
58
56
```
59
57
60
-
### APNSwiftConfiguration
58
+
### APNSConfiguration
61
59
62
-
[`APNSwiftConfiguration`](https://github.com/kylebrowning/swift-nio-http2-apns/blob/master/Sources/APNSwift/APNSwiftConfiguration.swift) is a structure that provides the system with common configuration.
60
+
[`APNSConfiguration`](https://github.com/kylebrowning/swift-nio-http2-apns/blob/master/Sources/APNSwift/APNSConfiguration.swift) is a structure that provides the system with common configuration.
63
61
64
62
```swift
65
-
let apnsConfig =tryAPNSwiftConfiguration(
63
+
let apnsConfig =tryAPNSConfiguration(
66
64
authenticationConfig: authenticationConfig,
67
65
topic: "com.grasscove.Fern",
68
66
environment: .sandbox,
69
67
logger: logger
70
68
)
71
69
```
72
70
73
-
#### APNSwiftConfiguration.Authentication
74
-
[`APNSwiftConfiguration.Authentication`](https://github.com/swift-server-community/APNSwift/blob/master/Sources/APNSwift/APNSwiftConfiguration.swift#L26) is a struct that provides authentication keys and metadata to the signer.
71
+
#### APNSConfiguration.Authentication
72
+
[`APNSConfiguration.Authentication`](https://github.com/swift-server-community/APNSwift/blob/master/Sources/APNSwift/APNSConfiguration.swift#L26) is a struct that provides authentication keys and metadata to the signer.
75
73
76
74
77
75
```swift
78
-
let authenticationConfig: APNSwiftConfiguration.Authentication = .init(
76
+
let authenticationConfig: APNSConfiguration.Authentication = .init(
[`APNSwiftConnection`](https://github.com/kylebrowning/swift-nio-http2-apns/blob/master/Sources/APNSwift/APNSwiftConnection.swift) provides functions to send a notification to a specific device token string.
85
+
[`APNSClient`](https://github.com/kylebrowning/swift-nio-http2-apns/blob/master/Sources/APNSwift/APNSClient.swift) provides functions to send a notification to a specific device token string.
88
86
89
87
90
-
#### Example `APNSwiftConnection`
88
+
#### Example `APNSClient`
91
89
```swift
92
-
let apns =APNSwiftConnection(configuration: apnsConfig, logger: logger)
90
+
let apns =APNSClient(configuration: apnsConfig)
93
91
```
94
92
95
-
### APNSwiftAlert
93
+
### APNSAlert
96
94
97
-
[`APNSwiftAlert`](https://github.com/kylebrowning/APNSwift/blob/tn-concise-naming/Sources/APNSwift/APNSwiftAlert.swift) is the actual meta data of the push notification alert someone wishes to send. More details on the specifics of each property are provided [here](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html). They follow a 1-1 naming scheme listed in Apple's documentation
95
+
[`APNSAlert`](https://github.com/kylebrowning/APNSwift/blob/tn-concise-naming/Sources/APNSwift/APNSAlert.swift) is the actual meta data of the push notification alert someone wishes to send. More details on the specifics of each property are provided [here](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html). They follow a 1-1 naming scheme listed in Apple's documentation
98
96
99
97
100
-
#### Example `APNSwiftAlert`
98
+
#### Example `APNSAlert`
101
99
```swift
102
-
let alert =APNSwiftAlert(title: "Hey There", subtitle: "Full moon sighting", body: "There was a full moon last night did you see it")
100
+
let alert =APNSAlert(title: "Hey There", subtitle: "Full moon sighting", body: "There was a full moon last night did you see it")
103
101
```
104
102
105
-
### APNSwiftPayload
103
+
### APNSPayload
106
104
107
-
[`APNSwiftPayload`](https://github.com/kylebrowning/APNSwift/blob/tn-concise-naming/Sources/APNSwift/APNSwiftPayload.swift) is the meta data of the push notification. Things like the alert, badge count. More details on the specifics of each property are provided [here](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html). They follow a 1-1 naming scheme listed in Apple's documentation
105
+
[`APNSPayload`](https://github.com/kylebrowning/APNSwift/blob/tn-concise-naming/Sources/APNSwift/APNSPayload.swift) is the meta data of the push notification. Things like the alert, badge count. More details on the specifics of each property are provided [here](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/PayloadKeyReference.html). They follow a 1-1 naming scheme listed in Apple's documentation
108
106
109
107
110
-
#### Example `APNSwiftPayload`
108
+
#### Example `APNSPayload`
111
109
```swift
112
110
let alert =...
113
-
let aps =APNSwiftPayload(alert: alert, badge: 1, sound: .normal("cow.wav"))
111
+
let aps =APNSPayload(alert: alert, badge: 1, sound: .normal("cow.wav"))
114
112
```
115
113
116
114
### Custom Notification Data
117
115
118
-
Apple provides engineers with the ability to add custom payload data to each notification. In order to facilitate this we have the `APNSwiftNotification`.
116
+
Apple provides engineers with the ability to add custom payload data to each notification. In order to facilitate this we have the `APNSNotification`.
119
117
120
118
#### Example
121
119
```swift
122
120
structAcmeNotification: APNSwiftNotification {
123
121
let acme2: [String]
124
-
let aps: APNSwiftPayload
122
+
let aps: APNSPayload
125
123
126
-
init(acme2: [String], aps: APNSwiftPayload) {
124
+
init(acme2: [String], aps: APNSPayload) {
127
125
self.acme2= acme2
128
126
self.aps= aps
129
127
}
130
128
}
131
129
132
-
let apns: APNSwiftConnection: =...
133
-
let aps: APNSwiftPayload=...
130
+
let apns: APNSClient: =...
131
+
let aps: APNSPayload=...
134
132
let notification =AcmeNotification(acme2: ["bang", "whiz"], aps: aps)
135
133
let res =try apns.send(notification, to: "de1d666223de85db0186f654852cc960551125ee841ca044fdf5ef6a4756a77e")
0 commit comments