Search code examples
flutterpusher

Why I can't send a Map in flutter pusher?


I am currently working on a project with pusher, but I am encoutering a problem with ONLY sending it seems like channel.trigger is not working for me

send(int status) async {
try{
  await channel.trigger('${widget.data['id']}', data: '{"name":"Zeus"}').then((value) => print(value));
}catch(e){
  print("XXX $e");
}
}

can you help me find the solution for this?


Solution

  • I found the solution for this one I did and experiment on the payload and found out that the problem is the payload, before I used to send data like this

    {
      "name":"Test"
    }
    

    then I tried using

    {
      "\"name\"" : "\"Test\""
    }
    

    and it worked I dont know if they updated it or not but it worked for me this way