Token strong get changed on fly

Vuyiswa Maseko 351 Reputation points
2022-04-18T20:24:43.67+00:00

Good Day

i have a webapi with a function defined like this

[HttpPost]  
[ActionName("MyPush")]     
public void MyPush([FromBody] PUSH_MESSAGE model)  
{  

one of the field is a token , which comes in this format , with some escape characters

193940-failing-token.png

and it does not work when passed to Firebase and if i just assign the string directly that looks like this

193974-working.png
the string above works

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,325 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Vuyiswa Maseko 351 Reputation points
    2022-04-19T09:37:20.61+00:00

    i found a solution , in the webapi controller i needed to deserialize it like this to get rid of that character

       string token  = JsonConvert.DeserializeObject<string>(model.RECEIVER_TOKEN);
    

    and it worked.

    Thanks