我使用此请求向 FCM 发送显示消息:
curl -i -H 'Content-type: application/json' -H 'Authorization: ****' -XPOST https://fcm.googleapis.com/fcm/send -d '{"time_to_live":120,"priority":"high","content_available":true,"condition":"'\''4pz87gsel7183b7kcadw1dwzv'\'' in topics OR '\''4njsfszcgd9m765d6suktsz2a'\'' in topics OR '\''match-4i5yvb5co56meztqpc1quflk9'\'' in topics","data":{"event_id":"4i5yvb5co56meztqpc1quflk9_20180715150017","timestamp":1531666817},"notification":{"title":"test123,"body":"\u231a test123","sound":"sound","click_action":"my_action_link","android_channel_id":"ticker"}}'
Run Code Online (Sandbox Code Playgroud)
但有时这条消息需要长达 10 分钟才能传递给客户?(适用于 iOS 和 Android)。我怎样才能实现更快的交货?
如果有一个对象(在我的情况下是TJSONData)并且我想释放这个对象,则程序流有时会挂起在这个位置.我的代码中已经有了类似下面的结构,但有时似乎不适合这种情况:
if Assigned(MyRecord.MyJSONData) then
begin
MyRecord.MyJSONData.Free;
end;
Run Code Online (Sandbox Code Playgroud)
如果我尝试释放对象两次,我可以在测试中重现此行为.在我的程序中,这通常不会发生,但现在我真正的问题:
有没有办法检查对象是否已经空闲?或者我还需要使用FreeAndNil();?