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
+60-18Lines changed: 60 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ A non-blocking Swift module for sending remote Apple Push Notification requests
9
9
10
10
## Installation
11
11
12
-
To install `APNSwift`, just add the package as a dependency in your [**Package.swift**](https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageDescriptionV4.md#dependencies). Though you may want to consider using master branch until approved by the SSWG.
12
+
To install `APNSwift`, just add the package as a dependency in your [**Package.swift**](https://github.com/apple/swift-package-manager/blob/master/Documentation/PackageDescriptionV4.md#dependencies).
13
13
14
14
```swift
15
15
dependencies: [
@@ -28,13 +28,17 @@ let apnsConfig = APNSwiftConfiguration(keyIdentifier: "9UC9ZLQ8YW",
28
28
topic: "com.grasscove.Fern",
29
29
environment: .sandbox)
30
30
31
+
structBasicNotification: APNSwiftNotification {
32
+
var aps: APNSwiftPayload
33
+
}
31
34
let apns =try APNSwiftConnection.connect(configuration: apnsConfig, on: group.next()).wait()
32
-
let alert =Alert(title: "Hey There", subtitle: "Full moon sighting", body: "There was a full moon last night did you see it")
35
+
let alert =APNSwiftPayload.APNSwiftAlert(title: "Hey There", subtitle: "Full moon sighting", body: "There was a full moon last night did you see it")
33
36
let aps =APNSwiftPayload(alert: alert, badge: 1, sound: .normal("cow.wav"))
34
-
let notification =APNSwiftNotification(aps: aps)
35
-
let res =tryapns.send(notification, to: "de1d666223de85db0186f654852cc960551125ee841ca044fdf5ef6a4756a77e").wait()
37
+
let notification =BasicNotification(aps: aps)
38
+
let res = apns.send(notification, pushType: .alert, to: "de1d666223de85db0186f654852cc960551125ee841ca044fdf5ef6a4756a77e")
0 commit comments