Skip to content
Back

FCM Message error

  • 0
  • 1
  • Self Hosted
  • Flutter
  • Messaging
26 Aug, 2026, 21:17

When creating a message target via flutter sdk via

TypeScript
final target = await _account.createPushTarget(
        targetId: targetId,
        identifier: deviceToken,
        providerId: providerId,
      );

and then creating a new message via web ui, there is an error showing up and the push is not send. logs from web ui:

TypeScript
Failed sending to targets with error: Utopia\Messaging\Helpers\JWT::encode(): Argument #2 ($key) must be of type string, null given, called in /usr/src/code/vendor/utopia-php/messaging/src/Utopia/Messaging/Adapter/Push/FCM.php on line 63

provider is fcm.

Appwrite version: 1.9.6 Flutter sdk version: ^25.0.0

TL;DR
When sending push notifications using Flutter SDK and targeting devices, an error occurs with FCM provider showing "Utopia\Messaging\Helpers\JWT::encode(): Argument #2 ($key) must be of type string, null given." This issue prevents the push notifications from being sent successfully. The versions used are Appwrite 1.9.6 and Flutter SDK ^25.0.0.
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