-
Notifications
You must be signed in to change notification settings - Fork 43
Swift 5.2.1 Support #32
Copy link
Copy link
Closed
Description
When updating to version 2.10.0 a compile error was introduce on file FCM/Sources/FCM/Helpers/FCM+BatchSend.swift although updating to Swift 5.3 fixes the issue, the 5.2.1 version is relatively new and the fix to make it compatible is minimal.
it will be to insert 2 self. in the return statement of _send(_ message: FCMMessageDefault, tokens: [String]) -> EventLoopFuture<[String]> to.
// Before
return getAccessToken().flatMap { accessToken in
tokens.chunked(into: 500).map { chunk in
_sendChunk(
message,
tokens: chunk,
urlPath: urlPath,
accessToken: accessToken
)
}
.flatten(on: client.eventLoop)
.map { $0.flatMap { $0 } }
}
// After
return getAccessToken().flatMap { accessToken in
tokens.chunked(into: 500).map { chunk in
self._sendChunk(
message,
tokens: chunk,
urlPath: urlPath,
accessToken: accessToken
)
}
.flatten(on: self.client.eventLoop)
.map { $0.flatMap { $0 } }
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels