Skip to content

Swift 5.2.1 Support #32

@JCTec

Description

@JCTec

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 } }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions