Hi Alex,
For the time out message, you should be able to catch the exception and display your own message.
Regarding https, you can use either 'http:' or 'https:' when making a request to Google. Kinvey uses Google cloud storage for files.
Here's some info from Kinvey on it:
devcenter.kinvey.com/rest/guides/files#S...communicatingwithGCS
So, the solution is to modify the URLs we get from Kinvey to have an 'https:' prefix. You will need to edit the
REST.Backend.KinveyAPI source file found in source/data/rest/.
I would recommend saving a copy of the file in the same folder as your project. Then add the file to your project in Delphi XE8, and select to use
the unit.
Here are the changes you will need to make to the REST.Backend.KinveyAPI source file:
1. We need a routine to change the prefix. Add this routine somewhere:
function ForceHTTPS(const AURL: string): string;
begin
if AURL.StartsWith('http:') then
Result := 'https:' + AURL.Substring(5)
else
Result := AURL;
end;
2. Modify the URL for upload (in TKinveyApi.RetrieveFile):
LJSONValue := LResponseObject.GetValue('_uploadURL'); // Do not localize
if LJSONValue <> nil then
LUploadURL := LJSONValue.Value;
Assert(LUploadURL <> '');
// Change to HTTPS
LUploadURL := ForceHTTPS(LUploadURL);
3. Modify the URL to download (TKinveyAPI.RetrieveFile):
LResponse := FRequest.Response.JSONValue as TJSONObject;
AFile := FileFromObject(LResponse);
// Change to HTTPS
AFile.FDownloadURL := ForceHTTPS(AFile.FDownloadURL);
if Assigned(AJSON) then
AJSON.AddElement(LResponse.Clone as TJSONObject);
if Assigned(AProc) then
AProc(AFile, LResponse);
end
end;
Regards,
Sarina