
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
- sdk-for-apple v.10.2.0 produces errors
I am trying to get the Apple SDK v10.2.0 to work on my tvOS project. I previously used v6.0.0 but decided to update. When I update the dependencies, the build f...
- NO BOT
- Adding Custom Domain to self-hosted Appw...
Hi, i deployed Appwrite with Coolify and reaching it with appw.appname.de. What is working so far. I wanted to add another custom Domain to activate email verif...
