"For developers", "Server scripts", "Functions description", "Users", "mGetGeoPosition".
The function is for getting the geopositioning of a user's device by its CID (Connection ID). If a device managed to get its coordinates, it responds to the server and the current position stores in the server's database.
function mGetGeoPosition(const iCID: int64): integer;
Parameter |
Type |
Value |
---|---|---|
iCID |
int64 |
a unique ID of a user's connection number; |
0 function executed successfully;
-1 invalid/incorrect CID;
The script gets all active Android and iOS connections of the user with UIN=6 and sends a geoposition request.
const
UIN = 6; // user UIN for test, set your own number
CLIENT_TYPE = 'android,ios';
var
iCID: integer;
sCIDList: string;
begin
sCIDList := mGetCIDSByUINAndClientType(UIN, CLIENT_TYPE);
while length(sCIDList) > 0 do begin
iCID := StrToInt(Fetch(sCIDList, ','));
mGetGeoPosition(iCID);
end;
end.
[09:59:17] (Run "mGetGeoPosition"): Script execution time: 2 ms
[09:59:17] (Run "mGetGeoPosition"): Script done successfully.