App.request error on iOS but working on Android

Hi, I can’t solve this problem.
I have two app.request requests.
The former works fine on iOS and Android, but the latter only works on Android.

Explanation: the first app.request generates a virtual list with elements, these elements are the ones that call, through a function, the second app.request.

First request

app.request({
url: 'http://xxx.xx.xx.xx/webapps/get_producto.php?NOM_LARGO=' + busquedaUpper,
method: 'POST',
dataType: 'XML',
crossDomain: true,
success: function (data, textStatus) {
var doc = $$(new DOMParser().parseFromString(data, 'text/html'));
doc.find('producto').forEach(function (itm) {
// ... here generates the list ...
});
var virtualList = app.virtualList.create({
// List Element
el: '.virtual-list-busqueda',
cache: false,
// Pass array with items
items: lista_medicamentos,
emptyTemplate: 'No se encontraron resultados.',
// List item Template7 template
itemTemplate: '<li class="btn-sucursales" id="medicamento{{codigo}}" data-codigo="{{codigo}}">' +
'<a href="#" onClick="sucursalFunction(this)" class="item-link item-content no-padding-left" data-codigo="{{codigo}}" data-nombre="{{nombre}}" id="{{nombre}}">' +
'<div class="item-inner padding-left padding-right-half">' +
'<div class="item-title">' +
'<span class="busqueda-resultados-titulo"><b>{{nombre}}</b></span>' +
'<div class="item-footer">Ver sucursales</div>' +
'</div>' +
'<div class="item-after"><i class="material-icons rotar-0">add</i></div>' +
'</div>' +
'</a>' +
'</li>',
});
app.preloader.hideIn('.preloader-div');
},

This onClick calls the second request onClick="sucursalFunction(this)"

Second request (same url of the first request)

function sucursalFunction(data) {
var codigo = $$(data).attr('data-codigo');
var nombre = $$(data).attr('data-nombre');
var lista_sucursales = [];
app.request({
url: 'http://1xx.1xx.xxx.xxx/webapps/get_stock.php?cod_alfabeta=' + codigo,
method: 'POST',
dataType: 'XML',
crossDomain: true,
beforeSend: function() {                        
console.log('http://xxx.1xx.2xx.1xx/webapps/get_stock.php?cod_alfabeta=' + codigo);
},
success: function (dataProducto) {
var docsuc = $$(new DOMParser().parseFromString(dataProducto, 'text/html'));
docsuc.find('sucursal').forEach(function (itmsuc) {
// averiguo si hay stock
var stock_suc = $$(itmsuc).find('can_stk').text();
// si tiene stock lo inserto en la variable
if (stock_suc > 0) {
var nombre_suc = $$(itmsuc).find('nom_sucursal').text();
var localidad_suc = $$(itmsuc).find('des_localidad').text();
var telefono_suc = $$(itmsuc).find('des_tel').text();
var direccion_suc = $$(itmsuc).find('des_direccion').text();
var suc = {};
suc.sucursal = nombre_suc;
suc.localidad = localidad_suc;
suc.telefono = telefono_suc;
suc.direccion = direccion_suc;
suc.stock = stock_suc;
lista_sucursales.push(suc);
}
});
 // Comparar localidades y ordenar
function compare(a, b) {
// Use toUpperCase() to ignore character casing
const localidadA = a.localidad.toUpperCase();
const localidadB = b.localidad.toUpperCase();
let comparison = 0;
if (localidadA > localidadB) {
comparison = 1;
} else if (localidadA < localidadB) {
comparison = -1;
}
return comparison;
}
// Fin comparar localidades
 lista_sucursales.sort(compare);
var popupTemplate = Template7.compile(
'<div class="popup sucursales-popup">' +
'<div class="view">' +
'<div class="page bg-color-white">' +
'<div class="navbar bg-color-white">' +
'<div class=""></div>' +
// ... here generates the list ...
'</div>' +
' </div>',
);
app.popup.create({
swipeToClose: true,
content: popupTemplate({
lista_sucursales
})
}).open();
},
error: function (xhr, textStatus, errorThrown) {
var msg = '';
if (xhr.status == 0) {
msg = 'Not connect.\n Verify Network.';
} else if (xhr.status == 404) {
msg = 'Requested page not found. [404]';
} else if (xhr.status == 500) {
msg = 'Internal Server Error [500].';
} else if (textStatus === 'parsererror') {
msg = 'Requested JSON parse failed.';
} else if (textStatus === 'timeout') {
msg = 'Time out error.';
} else if (textStatus === 'abort') {
msg = 'Ajax request aborted.';
} else {
msg = 'Uncaught Error.\n' + xhr.responseText;
}
console.log(msg);
console.log(errorThrown);
},
});
};

The data arrives ok to the second request, because in the beforeSend the console.log shows me the url with the parameter correctly.

The error it gives me is not that I do not have an internet connection, but that is not the case.

I am using framework7 v.6 version
I can’t determine why it doesn’t work on iOS, on Android it works perfectly. The function is called and with the correct parameters, since beforeSend shows me on the console that it is so.
Thanks in advance.
I’m stuck with this.

fix your response headers
lines are missing in second request:

Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Methods: GET, POST, PUT, DELETE
Access-Control-Allow-Origin: *

#first-request

Request URL: http://138.118.214.152/webapps/get_producto.php
Request Method: GET
Status Code: 200 OK
Remote Address: 138.118.214.152:80
Referrer Policy: strict-origin-when-cross-origin
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Access-Control-Allow-Methods: GET, POST, PUT, DELETE
Access-Control-Allow-Origin: *
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 1137
Content-Type: text/html; charset=UTF-8
Date: Thu, 02 Jun 2022 16:48:44 GMT
Keep-Alive: timeout=5, max=100
Server: Apache/2.2.15 (CentOS)
Vary: Accept-Encoding
X-Powered-By: PHP/5.3.3

#second-request

Request URL: http://138.118.214.152/webapps/get_stock.php
Request Method: GET
Status Code: 200 
Referrer Policy: strict-origin-when-cross-origin
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 987
Content-Type: text/html; charset=UTF-8
Date: Thu, 02 Jun 2022 16:49:45 GMT
Keep-Alive: timeout=5, max=99
Server: Apache/2.2.15 (CentOS)
Vary: Accept-Encoding
X-Powered-By: PHP/5.3.3

Thanks i fix that.
But why in android works?

android (and its browser) is less restrictive