urlProgress seems not work SOLVED
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
urlProgress seems not work SOLVED
Hi All,I use urlProgress while a download an https .zip file
It seems urlProgress doesn't work (LC. 8.1.3, iOS 10.2.1) although download is done.
Is there someone get the same result ?
Best regards
Jean-Marc
It seems urlProgress doesn't work (LC. 8.1.3, iOS 10.2.1) although download is done.
Is there someone get the same result ?
Best regards
Jean-Marc
Last edited by jmburnod on Tue Feb 07, 2017 11:07 am, edited 1 time in total.
https://alternatic.ch
-
- Livecode Staff Member
- Posts: 864
- Joined: Fri Feb 06, 2015 4:03 pm
Re: urlProgress seems not work
Hi Jean-Marc,
I guess you have included the "Internet" library in the standalone, is that correct?
If this is the case, then the "libUrl" library is used for networking on mobile platforms. The "urlProgress" is not supported by "libUrl". The "urlProgress" is implemented in the engine.
So you have two options:
1. Do not add "Internet" inclusion. This will result in the engine behavior to be used, so you can use "urlProgress"
OR
2. Add "Internet" inclusion. This includes "libUrl" in the standalone, which overrides the default engine behaviour. You cannot use "urlProgress", but you can use "libURLSetStatusCallback" instead.
Best,
Panos
--
I guess you have included the "Internet" library in the standalone, is that correct?
If this is the case, then the "libUrl" library is used for networking on mobile platforms. The "urlProgress" is not supported by "libUrl". The "urlProgress" is implemented in the engine.
So you have two options:
1. Do not add "Internet" inclusion. This will result in the engine behavior to be used, so you can use "urlProgress"
OR
2. Add "Internet" inclusion. This includes "libUrl" in the standalone, which overrides the default engine behaviour. You cannot use "urlProgress", but you can use "libURLSetStatusCallback" instead.
Best,
Panos
--
Re: urlProgress seems not work
Hi Panos,
Thanks for your quick reply
I use urlProgress for ios and libUrlSetStatusCallback for OS X and Windows (only one file for all platforms).
That worked fine with LC 7.06.
Is there a change about this ?
Best
Jean-Marc
Thanks for your quick reply
Yes SirI guess you have included the "Internet" library in the standalone, is that correct?
I use urlProgress for ios and libUrlSetStatusCallback for OS X and Windows (only one file for all platforms).
That worked fine with LC 7.06.
Is there a change about this ?
Best
Jean-Marc
https://alternatic.ch
-
- Livecode Staff Member
- Posts: 864
- Joined: Fri Feb 06, 2015 4:03 pm
Re: urlProgress seems not work
Hi Jean-Marc,
Ok, I think I know what happens:
1. Including "Internet" loads "libURL" in the standalone. This means that "libUrlSetStatusCallback" will work, but "urlStatus" will not.
2. Not including "Internet" will make the standalone to use the engine built-in networking support for mobile, so "urlStatus" will work for iOS. However, desktop standalones (OS X and Windows) will not have networking support at all, so "libUrlSetStatusCallback" will not work on them.
So I think the workaround in LC 8.1.x is to do the same, i.e.
- Build a standalone for iOS with *no* Internet inclusion checked.
- Build a standalone for OS X and Windows with Internet inclusion checked.
Best regards,
Panos
--
Ok, I think I know what happens:
1. Including "Internet" loads "libURL" in the standalone. This means that "libUrlSetStatusCallback" will work, but "urlStatus" will not.
2. Not including "Internet" will make the standalone to use the engine built-in networking support for mobile, so "urlStatus" will work for iOS. However, desktop standalones (OS X and Windows) will not have networking support at all, so "libUrlSetStatusCallback" will not work on them.
Yes, the change is that in LC 8.1.x you can build standalones *for both Desktop and Mobile platforms" in one go. This was not possible in LC 7.0.6. In LC 7.0.6 you had to first build for Desktop platforms, and then for Mobile.That worked fine with LC 7.06.
Is there a change about this ?
So I think the workaround in LC 8.1.x is to do the same, i.e.
- Build a standalone for iOS with *no* Internet inclusion checked.
- Build a standalone for OS X and Windows with Internet inclusion checked.
Best regards,
Panos
--
Re: urlProgress seems not work
Hi Panos,
Thanks again
I tried without internet inclusion but i use a put url to check the connection
Without internet inclusion, it return false of course
I taked it off and download works.
I was surprised that libURLDownloadToFile works without internet inclusion.
Remains one question:
Which is the best way to check internet connection without internet inclusion ?
All the best
Jean-Marc
Thanks again
I tried without internet inclusion but i use a put url to check the connection
Code: Select all
put url "http://www.alternatic.ch/jmb/ecrireenpictos/MiseJourHistoriqueEEP.txt" into tCurVersion
return (the result = empty)
I taked it off and download works.
I was surprised that libURLDownloadToFile works without internet inclusion.
Remains one question:
Which is the best way to check internet connection without internet inclusion ?
All the best
Jean-Marc
https://alternatic.ch
-
- Livecode Staff Member
- Posts: 864
- Joined: Fri Feb 06, 2015 4:03 pm
Re: urlProgress seems not work
Hi Jean-Marc,
The does work without "Internet" inclusion, since it uses the engine implementation of "put url". If this code returned false to you, it might be because of something else.
is implemented in the mobile engine, too.
BTW, if you are using Indy or Business, I suggest you do the same action with "Internet" and "tsNet", i.e.
- If you uncheck "Internet", then uncheck tsNet as well.
- If you check "Internet", then check tsNet as well.
code you use, since it should work without "Internet" inclusion, too.
Another thing that you need to know is that currently there is a bug (http://quality.livecode.com/show_bug.cgi?id=18833) where deploying to iOS simulator (and probably device, too) unloads the tsNet library. So I suggest you type in the msg box each time after deploying to iOS simulator. Again, this applies only if you are using Indy or Business.
Best,
Panos
--
The
Code: Select all
put url ..
Yes, this happens becauseI was surprised that libURLDownloadToFile works without internet inclusion.
Code: Select all
libURLDownloadToFile
BTW, if you are using Indy or Business, I suggest you do the same action with "Internet" and "tsNet", i.e.
- If you uncheck "Internet", then uncheck tsNet as well.
- If you check "Internet", then check tsNet as well.
I would say theWhich is the best way to check internet connection without internet inclusion ?
Code: Select all
put url ..
Another thing that you need to know is that currently there is a bug (http://quality.livecode.com/show_bug.cgi?id=18833) where deploying to iOS simulator (and probably device, too) unloads the tsNet library. So I suggest you type in the msg box
Code: Select all
start using stack tsNetLibURL
Best,
Panos
--
Re: urlProgress seems not work
Hi Panos,
I tested with Internet unchecked and tSnet unchecked
I get this result:
• IDE,"result = empty"
• iOS, result = "The ressource could not be loaded because the app Transport security policy requires the use of a secure connection"
I understand this happens because we recently have changed our site to https instead http
I tried also with https://www.alternatic... with this result
• IDE, tsneterr: (60) SSL certificate problem: Invalid certificate chain
• iOS, to do
Best again
Jean-Marc
I tested with Internet unchecked and tSnet unchecked
Code: Select all
on mouseUp
put url "http://www.alternatic.ch/jmb/ecrireenpictos/MiseJourHistoriqueEEP.txt" into tCurVersion
if the result = empty then
put "result = empty" into t
else
put the result into t
end if
answer t
end mouseUp
• IDE,"result = empty"
• iOS, result = "The ressource could not be loaded because the app Transport security policy requires the use of a secure connection"
I understand this happens because we recently have changed our site to https instead http
I tried also with https://www.alternatic... with this result
• IDE, tsneterr: (60) SSL certificate problem: Invalid certificate chain
• iOS, to do
Best again
Jean-Marc
https://alternatic.ch
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: urlProgress seems not work
Hi Jean-Marc
I just tried visiting http://www.alternatic.ch and my browser threw up this warning:
So it may be that your certificate (or some related setting on your server) is indeed wonky. My understanding is that ATS won't just accept a domain if it has a SSL cert, it has to be a cert that passes it's standards!
How about if you test against https://www.google.com?
I just tried visiting http://www.alternatic.ch and my browser threw up this warning:
So it may be that your certificate (or some related setting on your server) is indeed wonky. My understanding is that ATS won't just accept a domain if it has a SSL cert, it has to be a cert that passes it's standards!
How about if you test against https://www.google.com?
"...this is not the code you are looking for..."
Re: urlProgress seems not work
Hi Dave,
Thanks for the hint. I sent it to my partners who manage our site.
I write back once I get news about this
Kind regards
Jean-Marc
Thanks for the hint. I sent it to my partners who manage our site.
I write back once I get news about this
Kind regards
Jean-Marc
https://alternatic.ch
Re: urlProgress seems not work
Hi,
1.) The stuff Panos told about libURL was new to me & highly interesting. Is this documented anywhere? If not, it should.
2.) Firefox gives better error messages (translated by me):
Or have this tiny php on your server:and test its URL (if URL "http://myServer.net/myip.php" is empty then ...)
If it's empty, you have no internet. Else you have your real external IP, as bonus ;-)
Have fun!
1.) The stuff Panos told about libURL was new to me & highly interesting. Is this documented anywhere? If not, it should.
2.) Firefox gives better error messages (translated by me):
3.) To check internet connectivity, ping 8.8.8.8 & evaluate the result.www.alternatic.ch is using an invalid certificate.
The certificate is valid for *.infomaniak.ch only.
Or have this tiny php on your server:
Code: Select all
<?PHP
function getUserIP()
{
$client = @$_SERVER['HTTP_CLIENT_IP'];
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = $_SERVER['REMOTE_ADDR'];
if(filter_var($client, FILTER_VALIDATE_IP))
{
$ip = $client;
}
elseif(filter_var($forward, FILTER_VALIDATE_IP))
{
$ip = $forward;
}
else
{
$ip = $remote;
}
return $ip;
}
$user_ip = getUserIP();
echo $user_ip; // Output IP address [Ex: 177.87.193.134]
?>
If it's empty, you have no internet. Else you have your real external IP, as bonus ;-)
Have fun!
All code published by me here was created with Community Editions of LC (thus is GPLv3).
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
If you use it in closed source projects, or for the Apple AppStore, or with XCode
you'll violate some license terms - read your relevant EULAs & Licenses!
Re: urlProgress seems not work
Hi All,
Thanks for help
alternatic's partners have done a new ssl certificate and the test connect seems working without internet and tSnet inclusions as Panos said.
I also tried Dave's suggestion with google url and it works too.
@Axwald. Thanks for the hint. I know nothing yet about php but I will do some experiment.
Thanks for help
alternatic's partners have done a new ssl certificate and the test connect seems working without internet and tSnet inclusions as Panos said.
I also tried Dave's suggestion with google url and it works too.
@Axwald. Thanks for the hint. I know nothing yet about php but I will do some experiment.
https://alternatic.ch
Re: urlProgress seems not work SOLVED
Hi All,
Is this documented anywhere?
Yes for LiburlDownLoadTofile at "Cross-platform note:"
but no "Cross-platform note:" for urlProgress.
Best regards
Jean-Marc
Is this documented anywhere?
Yes for LiburlDownLoadTofile at "Cross-platform note:"
but no "Cross-platform note:" for urlProgress.
Best regards
Jean-Marc
https://alternatic.ch