In Monterey and LC 10 Dp6 I used to check if my standalone has an internet connection, using the following script:
Code: Select all
--check internet connection
--FIND pubblic IP ot return false
function CheckConnection pAlwaysCheck
local tAnswer,tArray,tHeaders, tRecvHeaders, tResult, tBytes
if not pAlwaysCheck then
if sMyIP is empty then
return false
else
return true
end if
end if
put empty into sMyIP
libUrlSetSSLVerification true --needed because to communicate with FMS it has to be false
put tsNetGetTimeouts() into tOldTimeouts --save old timeout
tsNetSetTimeouts 5, 7000, 7000, 7000, 30, 1000 --max 7 seconds wait, if no connection
--tsNetSetTimeouts 5,7000, 7000, 7000, 0, 0 --max 7 seconds wait, if no connection
put "https://api.ipify.org?format=json" into tGetString
put true into pSettings["no_reuse"] --this clear the cache??
put tsNetGetSync(tGetString, tHeaders, tRecvHeaders, tResult, tBytes, pSettings) into tArray
tsNetSetTimeouts item 1 of tOldTimeouts, item 2 of tOldTimeouts, item 3 of tOldTimeouts, item 4 of tOldTimeouts, item 5 of tOldTimeouts, item 6 of tOldTimeouts
libUrlSetSSLVerification false --needed because to communicate with FMS it has to be false
if tArray is not empty then
put JSONToArray(tArray) into tArray --mergJson extension must be enabled on mobile
put tArray["IP"] into sMyIP --local
put 0 into gPrefTF["NoConn"] --reset false connection to internet
--MyLog "","CheckConnection OK" && sMyIP
return true
else
--breakpoint
MyLog "","CheckConnection error" && tResult
return false
end if
end CheckConnection
Now, my script on Android returns the following errore:
I am not sure if this depends on Sonoma, LC 10 DP7 or "another" google policy update.tsneterr: (77) error setting certificate verify locations: CAfile: /data/user/0/com.trevix.it.segnapunto/files/ca-bundle.crt CApath: none
Any clue?
Thanks