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
-33Lines changed: 0 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,14 +31,6 @@ dependencies: [
31
31
]
32
32
```
33
33
34
-
## Foundations
35
-
`APNSwift` is built with a layered approach. It exposes three tiers of API's.
36
-
1. A [raw API](https://github.com/swift-server-community/APNSwift/blob/d60241fe2b6eb193331567a871697d3f4bdf70fb/Sources/APNSwift/APNSClient.swift#L254) that takes basic types such as `String`'s
37
-
2. A slightly more [semantically safe API](https://github.com/swift-server-community/APNSwift/blob/d60241fe2b6eb193331567a871697d3f4bdf70fb/Sources/APNSwift/APNSClient.swift#L183), which takes types, like [`APNSPriority`](https://github.com/swift-server-community/APNSwift/blob/main/Sources/APNSwift/APNSPriority.swift), [`APNSPushType`](https://github.com/swift-server-community/APNSwift/blob/main/Sources/APNSwift/APNSPushType.swift), [`APNSNotificationExpiration`](https://github.com/swift-server-community/APNSwift/blob/main/Sources/APNSwift/APNSNotificationExpiration.swift), etc.
38
-
3. The [safest API](https://github.com/swift-server-community/APNSwift/blob/d60241fe2b6eb193331567a871697d3f4bdf70fb/Sources/APNSwift/Alert/APNSClient%2BAlert.swift#L32) which takes fully semantic types such as [`APNSAlertNotification`](https://github.com/swift-server-community/APNSwift/blob/d60241fe2b6eb193331567a871697d3f4bdf70fb/Sources/APNSwift/Alert/APNSAlertNotification.swift#L177)
39
-
40
-
**We recommened using number 3, the semantically safest API to ensure your push notification is delivered correctly**. *This README assumes that you are using number 3.* However if you need more granular approach, or something doesn't exist in this library, please use 2 or 1. (Also please open an issue if we missed something so we can get a semantically correct version!)
41
-
42
34
## Getting Started
43
35
APNSwift aims to provide semantically correct structures to sending push notifications. You first need to setup a [`APNSClient`](https://github.com/swift-server-community/APNSwift/blob/main/Sources/APNSwift/APNSClient.swift). To do that youll need to know your authentication method
44
36
@@ -144,31 +136,6 @@ This logger can be passed into the `APNSClient` and will log background things l
144
136
#### **Notification Send Logger**
145
137
This logger can be passed into any of the `send:` methods and will log everything related to a single send request.
146
138
147
-
## Using the non semantic safe APIs
148
-
149
-
APNSwift provides the ability to send raw payloads. You can use `Data`, `ByteBuffer`, `DispatchData`, `Array`
150
-
Though this is to be used with caution. APNSwift cannot gurantee delivery if you do not have the correct payload.
151
-
For more information see: [Creating APN Payload](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html)
152
-
153
-
```swift
154
-
/// Extremely Raw,
155
-
tryawait client.send(
156
-
payload: payload,
157
-
deviceToken: token,
158
-
pushType: "alert", deadline: .distantFuture
159
-
)
160
-
161
-
/// or a little safer but still raw
162
-
tryawait client.send(
163
-
payload: payload,
164
-
deviceToken: token,
165
-
pushType: .alert,
166
-
expiration: .immediatly,
167
-
priority: .immediatly,
168
-
deadline: .distantFuture
169
-
)
170
-
```
171
-
172
139
## Server Example
173
140
Take a look at [Program.swift](https://github.com/swift-server-community/APNSwift/blob/main/Sources/APNSExample/Program.swift)
0 commit comments