22-09-2024, Saat: 02:53
Merhabalar, bir süredir Firebase den bildirim gelmiyor.
Sanırım bazı değişiklikler olmuş.
aşağıdaki şekilde gönderim yapıyordum.
Şimdi bu kod çalışmıyor.
Firebasın kendi consolundan mesaj gönderilce geliyor.
Ne yapmam gerekir?
Sanırım bazı değişiklikler olmuş.
aşağıdaki şekilde gönderim yapıyordum.
const
SunucuKey = 'AAAAu3fhQ3U:APA9......';
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Bildirim_Gonder(Baslik, Mesaj, Token : String);
begin
try
if Token<>'' then
begin
with RESTClient1 do
begin
Accept:='application/json, text/plain; q=0.9, text/html;q=0.8,';
AcceptCharset:='utf-8, *;q=0.8';
BaseURL:='https://fcm.googleapis.com/fcm/send';
ContentType:='application/json';
end;
RESTResponse1.ContentType:='application/json';
with RESTRequest1 do
begin
Params.Clear;
Client:=RESTClient1;
Method:=TRESTRequestMethod.rmPOST;
Params.Add;
Params[0].ContentTypeStr:='';
Params[0].Kind:=TRESTRequestParameterKind.pkHTTPHEADER;
Params[0].Name:='Authorization';
Params[0].Options:=[TRESTRequestParameterOption.poDoNotEncode];
Params[0].Value:='key='+SunucuKey;
Params.Add;
Params[1].ContentTypeStr:='application/json';
Params[1].Kind:=TRESTRequestParameterKind.pkREQUESTBODY;
Params[1].Name:='bodyA0D6608800FE4190BC786B8156E2C75F';
Params[1].Value:='{'+
'"to":"'+Token+'",'+
'"notification": {'+
'"title": "'+Baslik+'",'+
'"message": "'+Mesaj+'"'+
'}'+
'}';
Execute;
end;
end;
finally
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Bildirim_Gonder(edt_Baslik.Text,edt_mesaj.text,edt_token.Text);
end;
end.
Şimdi bu kod çalışmıyor.
Firebasın kendi consolundan mesaj gönderilce geliyor.
Ne yapmam gerekir?