
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
- Problem marking Apple Push-Notificaton a...
I was able to set up Push-Notifications via Appwrite function for my iOS App. I now wanted to increase the Badge count everytime the user gets a notifcation. Us...
- 2FA with Mail Help
Hello Appwrite Team. I would like to request Support for the following: Can you help me inserting the 2FA with Mail in my App? I don’t know how to do this... ...
- Relationships. Delete on cascade through...
Hi all!, When I delete a document throught the Apple SDK, on delete cascade is not working. If I delete the document from the console (Cloud), a dialog is show...
