Hello,
I'm using the following code to send Notifications to the Apple-APNs-Server. That works as expacted. Unfortunately after quitting I get a memory leak (2 x TsgcTCPNotifyObject). Any Ideas how to solve this?
if ABadge < 0 then ABadge := 0;
if ABadge > 99 then ABadge := 99;
LTitle := ATitle;
if Trim(LTitle) = '' then LTitle := 'Info';
LPayLoad := Format('{ "aps" : { "alert" : { "title" : "%s" }, "badge" : %d } }',[ATitle, ABadge]);
LStream := TStringStream.Create(LPayLoad, TEncoding.UTF8);
Try
LHTTP.Request.CustomHeaders.Clear;
LHTTP.Request.CustomHeaders.Add('apns-topic: '+cAPNSTopic);
LHTTP.Post(cURL + ADeviceToken, LStream);
if LHTTP.Response.Status = 200 then begin
Result := True;
end;
Finally
LStream.Free;
End;
Finally
LHTTP.Free;
End;
end;
Best Regards
Please login to post a reply
You will need to be logged in to be able to post a reply. Login using the form on the right or register an account if you are new here. Register Here »