Hi, i have this code… and works both debug.apk (on device) and ionic-lab, but when i put release.apk in play store the loading don`t dismiss.
i try with de same data and server.
constructor()
{
this.getInvoices();
}
getInvoices()
{
let headers = new Headers();
headers.append('Content-type','application/json');
headers.append('Access-Control-Allow-Origin','*');
headers.append('Content-type','application/x-www-form-urlencoded');
let body = {idUsuario:this.session['id_usuario'],
idCliente:this.customer['id'],
sessao:this.session['sessao'],
identificador:'app'};
let loading = this.loadingCtrl.create({content: 'Buscando Faturas...'});
loading.present();
this.http.post(this.url, JSON.stringify(body),{headers: headers}).map(res => res.json()).subscribe(data => {
this.invoices = data.dados;
loading.dismiss();
},(err) => {
this.get_from_heroku(loading);
});
}
get_from_heroku(loading)
{
this.http.get(this.url).map(res => res.json()).subscribe(data => {
this.invoices = data.dados;
loading.dismiss();
if(this.invoices == '')
{
this.toast("Não ha Faturas geradas!");
}
},(err) => {
loading.dismiss();
this.toast("Não foi possível obter as Faturas!");
});
}