Skip to content

Commit 0e899a8

Browse files
committed
readme + file cleanup
1 parent aebf627 commit 0e899a8

File tree

7 files changed

+70
-16
lines changed

7 files changed

+70
-16
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,19 @@ let apnsConfig = ...
8282
let apns = try APNSwiftConnection.connect(configuration: apnsConfig, on: group.next()).wait()
8383
```
8484

85-
### Alert
85+
### APNSwiftAlert
8686

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
8888

8989

90-
#### Example `Alert`
90+
#### Example `APNSwiftAlert`
9191
```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")
9393
```
9494

9595
### APNSwiftPayload
9696

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
9898

9999

100100
#### Example `APNSwiftPayload`
@@ -139,10 +139,13 @@ var apnsConfig = try APNSwiftConfiguration(
139139
)
140140
let apns = try APNSwiftConnection.connect(configuration: apnsConfig, on: group.next()).wait()
141141
```
142+
142143
### Need a completely custom arbtirary payload and dont like being typecast?
144+
143145
APNSwift provides the ability to send raw payloads. You can use `Data`, `ByteBuffer`, `DispatchData`, `Array`
144146
Though this is to be used with caution. APNSwift cannot gurantee delivery if you do not have the correct payload.
145147
For more information see: [Creating APN Payload](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html)
148+
146149
```swift
147150
let notificationJsonPayload = ...
148151
let data: Data = try! encoder.encode(notificationJsonPayload)

Sources/APNSwift/APNSwiftAlert.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the APNSwift open source project
4+
//
5+
// Copyright (c) 2020 the APNSwift project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of APNSwift project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
115
/// This structure provides the data structure for an APNS Alert
216
public struct APNSwiftAlert: Codable {
317
public let title: String?

Sources/APNSwift/APNSwiftClient.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the APNSwift open source project
4+
//
5+
// Copyright (c) 2019-2020 the APNSwift project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of APNSwift project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
115
import Foundation
216
import Logging
317
import NIO

Sources/APNSwift/APNSwiftConnection.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the APNSwift open source project
44
//
5-
// Copyright (c) 2019 the APNSwift project authors
5+
// Copyright (c) 2019-2020 the APNSwift project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the APNSwift open source project
4+
//
5+
// Copyright (c) 2020 the APNSwift project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of APNSwift project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
15+
/// This is a protocol which allows developers to construct their own Notification payload
16+
public protocol APNSwiftNotification: Encodable {
17+
var aps: APNSwiftPayload { get }
18+
}

Sources/APNSwift/APNSwiftRequest.swift renamed to Sources/APNSwift/APNSwiftPayload.swift

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// This source file is part of the APNSwift open source project
44
//
5-
// Copyright (c) 2019 the APNSwift project authors
5+
// Copyright (c) 2019-2020 the APNSwift project authors
66
// Licensed under Apache License v2.0
77
//
88
// See LICENSE.txt for license information
@@ -12,15 +12,6 @@
1212
//
1313
//===----------------------------------------------------------------------===//
1414

15-
import NIO
16-
import NIOHTTP1
17-
import NIOHTTP2
18-
19-
/// This is a protocol which allows developers to construct their own Notification payload
20-
public protocol APNSwiftNotification: Encodable {
21-
var aps: APNSwiftPayload { get }
22-
}
23-
2415
/// This structure provides the data structure for an APNS Payload
2516
public struct APNSwiftPayload: Encodable {
2617
public let alert: APNSwift.APNSwiftAlert?

Sources/APNSwift/APNSwiftSound.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
//===----------------------------------------------------------------------===//
2+
//
3+
// This source file is part of the APNSwift open source project
4+
//
5+
// Copyright (c) 2020 the APNSwift project authors
6+
// Licensed under Apache License v2.0
7+
//
8+
// See LICENSE.txt for license information
9+
// See CONTRIBUTORS.txt for the list of APNSwift project authors
10+
//
11+
// SPDX-License-Identifier: Apache-2.0
12+
//
13+
//===----------------------------------------------------------------------===//
14+
115
public struct APNSSoundDictionary: Encodable {
216
public let critical: Int
317
public let name: String

0 commit comments

Comments
 (0)