Skip to content

README is outdated. #145

@genkernel

Description

@genkernel

Is your feature request related to a problem? Please describe.
Example code snippets from README do not compile.

Describe the solution you'd like
Updated README with recent syntax.

Describe alternatives you've considered
Void

Additional context
I dove into the source code and came up with below snippet that compiles and works.
By submitting this Issue I'm looking to:

  • have somebody to confirm that my code is OK or suggest a better solution.
  • have README.md file updated with code snippets that compile.
let auth = APNSwiftConfiguration.AuthenticationMethod.jwt(
            key: try ECDSAKey.private(filePath: ".../path-to/AuthKey.p8"),
            keyIdentifier: JWKIdentifier(string: "keyId-value"),
            teamIdentifier: "teamId-value"
        )
        
        let config = APNSwiftConfiguration(
            authenticationMethod: auth,
            topic: appBundleId,
            environment: isProduction ? .production : .sandbox,
            logger: nil,
            timeout: .seconds(10)
        )
        
        let eventLoopGroup = MultiThreadedEventLoopGroup(numberOfThreads: 1)

        let conn = try APNSwiftConnection.connect(
            configuration: config,
            on: eventLoopGroup.any()
        ).wait()

        // Use `send()` methods on `conn` to send push notifications.

Thanks for building this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions