I have a tremendous confusion. I have my function perfectly
getPromociones(id:any){
//
var url = "https:/xxx/promociones/ObtenerPromociones?IdCategoria="+id;
return this.http.get(url).subscribe(
(data)=>{
this.itemsdata=[];
this.data1 = data['Promociones'];
for(var i = 0; i <this.data1.length; i++){
//console.log('contador'+ i +' '+JSON.stringify(this.data[i]['Titulo']));
this.itemsdata[i] = {
"id":this.data1[i]['IdPromocion'],
"title":this.data1[i]['Titulo'],
"description":this.data1[i]['Descripcion'],
"image":this.data1[i]['Url'],
"precioUnitario":this.data1[i]['PrecioUnitario'],
"precioPromo":this.data1[i]['PrecioPromocional'],
"imageAlt":"avatar",
"icon":"icon-heart-outline",
"duration":this.data1[i]['PorcentajeDescuento']
}
}
this.data2={"headerImage":"assets/images/background/14.jpg",
"toolBarTitle":"Product",
"title":"Super discount",
"description":"50% OFF",
"iconLike":"icon-thumb-up",
"iconCar":"icon-cart-arrow-down",
"iconFavorite":"icon-heart",
"iconShare":"icon-share-variant",
"items":this.itemsdata
}
//this.toastCtrl.presentToast(JSON.stringify(this.data2));
console.log(JSON.stringify(this.data2));
},error=>{
console.error("error en la peticione");
});
}
when the test on my local computer everything excellent. The problem is that when I generate the apk, the phone does not leave anything and I show an alert and the request comes empty ..
I'm already going crazy. thanks to the customer