Back

Expired device token

  • 0
  • Functions
  • Messaging
  • Apple
  • Cloud
Nandu
31 Mar, 2025, 20:09

Hey everyone,

I'm trying to add push notifications to my app but keep getting an error: "Expired device token."

I have an Appwrite function triggered when a document is created in a collection. The function receives a userID, finds the corresponding targetID, and sends it to messaging. According to my logs, everything seems correct—it finds the right targetID and calls createPush.

However, the messaging service keeps failing with the error "Expired device token." The provider configuration appears correct. Also, I've tested the same device token directly with Apple Push Notifications, and it worked fine—I received the notification on my phone. This seems to happen when I run and my phone is connected to XCode.

when testing through TestFlight, the error differs to: TopicDisallowed

Does anyone know what might be causing this issue?

Thanks for any help!

TL;DR
Developers encountering "Expired device token" error while implementing push notifications. Despite seemingly correct configurations, the issue persists. Possible causes: - XCode connection affecting token validity. - Different error message ("TopicDisallowed") when testing with TestFlight. Solution: - Consider testing without XCode connection. - Review provider configurations and ensure correctness. - Verify push notification settings and configurations. - Check for any restrictions within the Apple Developer account.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more