
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
- Can not login with OAuth
Hello everyone i am trying to login with ios and android in react native - expo but it is not successful. And this is the code which i am using to login
- I had a new error pop up today when test...
I've been working on my app, it worked fine previously but now I recieve Invalid Origin: Register your new client as a new iOS platform on your project console ...
- Appwrite DNS & iCloud Mail Server Setup
Hello, My DNS settings are managed through Appwrite, and I would like to add a custom email address to iCloud. I have never had any issues setting this up direc...
