I'm importing APNS and VaporAPNS and when I want to use the framework I get this error Cannot find 'APNSAlertNotification' in scope I'm using the resources of the documentation
https://docs.vapor.codes/advanced/apns/
import APNS
import VaporAPNS
func routes(_ app: Application) throws {
app.get("hello") { req async -> String in
// Custom Codable Payload
struct Payload: Codable {
let acme1: String
let acme2: Int
}
// Create push notification Alert
let dt = "70075697aa918ebddd64efb165f5b9cb92ce095f1c4c76d995b384c623a258bb"
let payload = Payload(acme1: "hey", acme2: 2)
let alert = APNSAlertNotification(
alert: .init(
title: .raw("Hello"),
subtitle: .raw("This is a test from vapor/apns")
),
expiration: .immediately,
priority: .immediately,
topic: "my topic",
payload: payload
)
// Send the notification
try! await req.apns.client.sendAlertNotification(
alert,
deviceToken: dt,
deadline: .distantFuture
)
return "Hello, world!"
}
}
Errors that xcode throws
Cannot find 'APNSAlertNotification' in scope
Cannot infer contextual base in reference to member 'init'
Cannot infer contextual base in reference to member 'raw'
Cannot infer contextual base in reference to member 'raw'
Cannot infer contextual base in reference to member 'immediately'
Cannot infer contextual base in reference to member 'immediately'
Describe the bug
I'm importing
APNS
andVaporAPNS
and when I want to use the framework I get this errorCannot find 'APNSAlertNotification' in scope
I'm using the resources of the documentation https://docs.vapor.codes/advanced/apns/To Reproduce
Package definition
Where I'm using it
Errors that xcode throws
Steps to reproduce the behavior:
Environment