I get this error with the when using the sendBroadcastMessage function, here is my body
{"message":"Invalid API key","hint":"Double check your Supabaseanonorservice_roleAPI key."}
My code
This is sending a broadcast messages.
void sendBroadcastMessage(
String chatRoomId,
TextEditingController textController,
) async {
final message = textController.text;
if (message.isEmpty) return;
final channel = supabase.channel('chat_$chatRoomId').subscribe();
final res = await channel.sendBroadcastMessage(event: 'chat', payload: {
'message': message,
'user_id': Supabase.instance.client.auth.currentUser!.id,
'timestamp': DateTime.now().millisecondsSinceEpoch,
'message_type': 'text',
});
print(res);
}
I get this error with the when using the sendBroadcastMessage function, here is my body
{"message":"Invalid API key","hint":"Double check your Supabase
anonor
service_roleAPI key."}
My code This is sending a broadcast messages.
res
=Screenshot of a network debugger.![image](https://github.com/supabase/supabase-flutter/assets/156785520/ec0b73cd-2762-4612-97e2-cd34c082abe7)
Version: dart pub deps
flutter --version
Additional context
All functions related to the Supabase are actively working on my project
None of the problems with apiKey and anon are experienced when launching my application, the only problem seems to be this function.