HTML5 network.request()

Hi

the below link mentions this:

write a local web script on the same domain that will make your REST API calls and then echo the returned data back to network.request().

https://coronalabs.com/blog/2018/03/20/html5-builds-are-now-in-open-beta/

how should this be done … any example … all my apps use this and contact database through webservices but i couldn’t find any example to understand how to do this

Have you tried to just call your services like you’re currently doing?  Several developers have found that many web services can be accessed as long as your HTML5 app is hosted on a web server and it’s not running locally.  You may not need to do this.

Rob

when i used my local pc the app started working and crashed as soon as the code called the webserviice

when i installed the app on a webserver nothing started and i received this message

Exception thrown, see JavaScript console

so i believe the problem is with my web-hosting server

http://mhmoud86-002-site1.atempurl.com/cocktail/index.html

i will contact them right away and check why the site is not working

Thanks Rob.

I’ve looked at the app and its debug console:


blob:[http://mhmoud86-002-site1.atempurl.com/15fe0c91-2df7-46d5-9ef9-6bcf0a2cc37e:1](http://mhmoud86-002-site1.atempurl.com/15fe0c91-2df7-46d5-9ef9-6bcf0a2cc37e:1) Uncaught Error: Not Found : [http://mhmoud86-002-site1.atempurl.com/cocktail/cocktail.data](http://mhmoud86-002-site1.atempurl.com/cocktail/cocktail.data) 

    at XMLHttpRequest.xhr.onload (blob:[http://mhmoud86-002-site1.atempurl.com/15fe0c91-2df7-46d5-9ef9-6bcf0a2cc37e:1)](http://mhmoud86-002-site1.atempurl.com/15fe0c91-2df7-46d5-9ef9-6bcf0a2cc37e:1))

looks like missing data file

the file is there
 
see attachment please
 
but maybe it requires some permissions from the hosting server or placing the file elsewhere
 
i sent them an inquiry already … hope it is something simple … this is a must for me because Apple rejected my app and i need to make it run via web instead for apple users

i just received this reply … not sure what to do

**Dear Customer,

\Argeeleh\cocktail\cocktail.data this file cannot be served because of the extension configuration. If it is a script, add a handler. If the file should be downloaded, add a MIME map.

Thank you. **

i added MIME type for the extension .data and it worked!

thanks guys for everything

hope i don’t face problems with permissions like GPS, notifications…etc

because this is a delivery app based on GPS location. and it sends notifications

the behavior is a bit weird on the browser though!

please visit http://mhmoud86-002-site1.atempurl.com/cocktail/index.html

and select language then look at how the text box looks like

it should be equal in size to login text boxes, and placed on top of them … it is showing in a weird way and not letting me to enter data properly 

hmm… It works now, but there is an issue with input text

How does look the input field in Simulator ?

it looks perfect … even on the playstore

https://play.google.com/store/apps/details?id=com.gmail.aregeeleh.delivery

on apple devices it also looks perfect … but the app is rejected so i did not place it on apple store

only on the web it looks different

I Have another problem with Map View, which i’m using to get user GPS location

it is working perfectly on android and ios builds but on html5 it seems not to be working properly

what is the substitute for that because browsers allow requesting location

so my only 2 major problems so far are:

  1. native text fields rendering which is very important for any data entry like user name or password
  2. Map View

minor problem is that html view is not as good as desktop view from graphics point of view

Thanks…

Native text fields within group has wrong positions/scale. We are working on fixing that. For now quick fix - use native text fields outside of any groups.

MapView is not ported yet to HTML5. For now you can try to implement it using native JS plugin.

:frowning:

i’m not that good but i will try

Native text rendering should work properly with build 3280 

Have you tried to just call your services like you’re currently doing?  Several developers have found that many web services can be accessed as long as your HTML5 app is hosted on a web server and it’s not running locally.  You may not need to do this.

Rob

when i used my local pc the app started working and crashed as soon as the code called the webserviice

when i installed the app on a webserver nothing started and i received this message

Exception thrown, see JavaScript console

so i believe the problem is with my web-hosting server

http://mhmoud86-002-site1.atempurl.com/cocktail/index.html

i will contact them right away and check why the site is not working

Thanks Rob.

I’ve looked at the app and its debug console:


blob:[http://mhmoud86-002-site1.atempurl.com/15fe0c91-2df7-46d5-9ef9-6bcf0a2cc37e:1](http://mhmoud86-002-site1.atempurl.com/15fe0c91-2df7-46d5-9ef9-6bcf0a2cc37e:1) Uncaught Error: Not Found : [http://mhmoud86-002-site1.atempurl.com/cocktail/cocktail.data](http://mhmoud86-002-site1.atempurl.com/cocktail/cocktail.data) 

    at XMLHttpRequest.xhr.onload (blob:[http://mhmoud86-002-site1.atempurl.com/15fe0c91-2df7-46d5-9ef9-6bcf0a2cc37e:1)](http://mhmoud86-002-site1.atempurl.com/15fe0c91-2df7-46d5-9ef9-6bcf0a2cc37e:1))

looks like missing data file

the file is there
 
see attachment please
 
but maybe it requires some permissions from the hosting server or placing the file elsewhere
 
i sent them an inquiry already … hope it is something simple … this is a must for me because Apple rejected my app and i need to make it run via web instead for apple users