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
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -82,19 +82,19 @@ let apnsConfig = ...
82
82
let apns =try APNSwiftConnection.connect(configuration: apnsConfig, on: group.next()).wait()
83
83
```
84
84
85
-
### Alert
85
+
### APNSwiftAlert
86
86
87
-
[`Alert`](https://github.com/kylebrowning/swift-nio-http2-apns/blob/master/Sources/APNSwift/APNSRequest.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
87
+
[`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
88
88
89
89
90
-
#### Example `Alert`
90
+
#### Example `APNSwiftAlert`
91
91
```swift
92
-
let alert =Alert(title: "Hey There", subtitle: "Full moon sighting", body: "There was a full moon last night did you see it")
92
+
let alert =APNSwiftAlert(title: "Hey There", subtitle: "Full moon sighting", body: "There was a full moon last night did you see it")
93
93
```
94
94
95
95
### APNSwiftPayload
96
96
97
-
[`APNSwiftPayload`](https://github.com/kylebrowning/APNSwift/blob/master/Sources/APNSwift/APNSwiftRequest.swift#L25) 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
97
+
[`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
98
98
99
99
100
100
#### Example `APNSwiftPayload`
@@ -139,10 +139,13 @@ var apnsConfig = try APNSwiftConfiguration(
139
139
)
140
140
let apns =try APNSwiftConnection.connect(configuration: apnsConfig, on: group.next()).wait()
141
141
```
142
+
142
143
### Need a completely custom arbtirary payload and dont like being typecast?
144
+
143
145
APNSwift provides the ability to send raw payloads. You can use `Data`, `ByteBuffer`, `DispatchData`, `Array`
144
146
Though this is to be used with caution. APNSwift cannot gurantee delivery if you do not have the correct payload.
145
147
For more information see: [Creating APN Payload](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html)
148
+
146
149
```swift
147
150
let notificationJsonPayload =...
148
151
let data: Data =try! encoder.encode(notificationJsonPayload)
0 commit comments