Skip to content
Back

'Request contains an invalid argument.' for messages send with Cloud Console

  • 0
  • Flutter
  • Messaging
  • Cloud
Rienkk
20 Mar, 2025, 11:38

When sending a notification within the cloud console (with just a title and description).

I get this error:

Failed sending to target dqv6Wc40bEdfszpousRZwy:APA91bF8kIdBGMjB7Iqu22a1fEN_5lhsf05wY-510sQOV3YS8uvs7zwCM2NuKQgh7iDF15DPAYrq-osYEVaHBEQ1UqlxnOwg0C3Rv4x2SkTUebdE_XVVGkQ with error: Request contains an invalid argument.

What is also interesting is that the target is formatted with a '-' and ':' within the string. I am not sure if this is normal?

Some extra information:

  • Initially the notifications work, after registering the token (For 1 or 2 messages)
  • I validated that it happens on IOS (can't test on Android currently)

I register the token on device with the following method:

if (Platform.isIOS) { await FirebaseMessaging.instance.getAPNSToken(); }

final String? token = await FirebaseMessaging.instance.getToken();

TypeScript
if (token == null) {
  return null;
}

final String targetId = ID.unique();

  final Target target = await account.createPushTarget(
    targetId: targetId,
    identifier: token,
    providerId: 'xxxxxx',
  );

Which direction could I look into to debug this and is there a way to know what the invalid argument is?

TL;DR
Developers trying to send a notification via Cloud Console are receiving a "Request contains an invalid argument" error. The issue may be due to the target string containing "-" and ":". The problem occurs after registering the token and seems to affect IOS devices. To debug, developers can check the formatting of the target string and ensure proper token registration. Additionally, reviewing the documentation for valid arguments can help pinpoint the issue.
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