I am trying to send push notification through APNS. I tried sending message from apple's push service console and it showing message. But when i try to send message through appwrite i am getting this Failed sending to target "DeviceToken" with error: The registration token is not a valid FCM registration token In the photo it should have shown APNS in provider but is not showing. This is the code: func loginUser(email: String, password: String) async -> RequestStatus { do { _ = try await account.createEmailPasswordSession(email: email, password: password)
guard let token = UserDefaults.standard.string(forKey: "apnsToken") else {
return .error("Failed to get APNS token")
}
guard let target = try? await account.createPushTarget(
targetId: ID.unique(),
identifier: token
) else {
return .error("Failed to create push target")
}
UserDefaults.standard.set(target.id, forKey: "targetId")
DispatchQueue.main.async {
self.isLoggedIn = true
UserDefaults.standard.set(true, forKey: "isLoggedIn")
}
return .success
} catch {
return .error(error.localizedDescription)
}
}
Recommended threads
- updateSession not working anymore
Was something changed recently on Cloud since updateSession is no longer working and I get 400 when calling it, with following error: ``` { "message": "The...
- API returned 400
Hey, since I upgraded to Docker Engine v29 on macOS, I keep getting errors `time="2025-11-26T22:33:36Z" level=error msg="Provider connection error Error respons...
- AnyCodable not exposed in iOS SDK
I want to write some convenience functions for Teams.list() but the problem is, that I can't use the default <[String : AnyCodable]> as a return type for my con...