Hi, thanks for your answer. This is my ionic info. (I am using an iPhone X with iOS 11.2.6)
cli packages:
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : not installed
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 26.1.1
Node : v8.9.4
npm : 5.7.1
OS : Windows 7
Environment Variables:
ANDROID_HOME : C:\Users\cdurobaenas\AppData\Local\Android\Sdk
Misc:
backend : pro
I also made 2 videos, one with the working app (1st time) and other one, when I minimize and then open Ionic View again. Just for the record…the app is working perfectly fine, and always on Ionic DevApp, is only failing with Ionic View.
Working App
https://www.dropbox.com/s/gysvfsddk8pezvb/app_working_1st_time.mp4?dl=0
Non-working after being minimimzed:
https://www.dropbox.com/s/i1009d5dsnf2pai/app_not_working_after_minimize.mp4?dl=0
About the code, basically I am using a provider with a local json path and file:
import { Injectable } from '@angular/core';
import { Http, Response } from '@angular/http';
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
@Injectable()
export class RemoteServiceProvider {
getApiUrl: string = 'assets/json/hhtjson.json';
constructor(public http: Http) {
console.log('HHT RemoteServiceProvider loaded!');
}
getPosts() {
return this.http.get(this.getApiUrl)
.map((res: Response) => res.json())
}
}
and then I get the results on the newsPage:
ngOnInit() {
console.log('-Data parsed and initialized-');
this.page = 0;
this.getPosts(0)
}
getPosts(refresher) {
this.remoteService.getPosts().subscribe((data) => {
this.fullItemsList = data.rss.channel.item;
this.items = [];
for (let i = this.page; i < 10; i++) {
this.items.push(this.fullItemsList[i]);
}
if (refresher != 0)
refresher.complete();
}, (err) => {
alert("Se produjo un error al cargar");
});
}
getNext(infiniteScroll) {
setTimeout(() => {
this.page = this.page + 1;
var next = (this.page) * 10;
for (let i = next; i < next + 10; i++) {
if (i < this.fullItemsList.length)
this.items.push(this.fullItemsList[i]);
}
infiniteScroll.complete();
infiniteScroll.enable(false);
}, 500);
}
About the device logs…I’m afraid but this is happening on IonicView, so I don’t have any log I guess. On IonicDevApp is working just fine.
Thanks a lot for your help.
Cheers,
Cristian