In debug, I would take the token and add it to my sender and send PN. Deletei, recompile in release mode and now I can not send PN (Push Notification). See my sender's code:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void button_Click(object sender, RoutedEventArgs e)
{
Task t = new Task(async () =>
{
await SenderMessage();
});
t.Start();
}
public static async Task<IFCMResponse> SenderMessage()
{
FCMClient client = new FCMClient("AAAA0myCZjE:APA91bETPO0K3EtgBhHz_gMXDtBTiQrCsFaOW8wmFxbk5XKrQ57KvYhxTRIW9ZQR_mxNU8ThWe0d0A40JzG-GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG/
var message = new Message()
{
To = "Meu_Token_Gerado_Em_Debug_Anteriormente", //topic example /topics/all
Notification = new AndroidNotification()
{
Body = "Solicitação de Novo Desconto",
Title = "Desconto",
}
};
//CrossBadge.Current.SetBadge(1, "Teste");
var result = await client.SendMessageAsync(message);
return result;
}
}
Is there any way to fix a token for the App? I tried to create a topics and send the PN for topics, but it gives an error. This is the code for creating topics
And this is the error:
Not Registered
EDIT1
I apologize to everyone, I've mixed things up. This message is not from receiving PN, but from trying to create a topics to receive PN, but they are different things. I'll remove that part. He was being helped by Perozzo and even so, it did not affect anything, because he understood throughout our conversation my problem, although it refers to the message posted by me. My mistake, I posted in the "crash" of wanting to solve.