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
### Need a completely custom arbtirary payload and dont like being typecast?
215
+
APNSwift provides the ability to send rawBytes `ByteBuffer` as a payload.
216
+
This is to be used with caution. APNSwift cannot gurantee delivery if you do not have the correct payload.
217
+
For more information see: [Creating APN Payload](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html)
218
+
```swift
219
+
let notificationJsonPayload =...
220
+
let data: Data =try! encoder.encode(notificationJsonPayload)
221
+
var buffer =ByteBufferAllocator().buffer(capacity: data.count)
222
+
buffer.writeBytes(data)
223
+
try apns.send(rawBytes: buffer, pushType: .alert, to: "<DEVICETOKEN>")
returnsend(rawBytes: buffer, pushType: pushType, to: deviceToken)
161
+
}
162
+
163
+
/// This is to be used with caution. APNSwift cannot gurantee delivery if you do not have the correct payload.
164
+
/// For more information see: [Creating APN Payload](https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CreatingtheNotificationPayload.html)
165
+
publicfunc send(rawBytes payload:ByteBuffer, pushType:APNSwiftConnection.PushType, to deviceToken:String, expiration:Date?=nil, priority:Int?=nil, collapseIdentifier:String?=nil, topic:String?=nil)->EventLoopFuture<Void>{
0 commit comments