angular - How to get back to the app after In App Browser view -
i have implemented in app browser-native feature on app.that feature working fine.now have issue.when user clicks button of device after go web page doesn't show dynamic data on app.i have implemented data fetching part inside constructor()
.can tell me how solve issue? app working fine on other use cases.this happens when go browser.
this video issue.
constructor(public storage: storage) { super(storage); super.gettoken().then((val) => {//get token this.token = val; this.geteventlist(this.token); }); } //get event list geteventlist(data): { this.eventdata.geteventlist(data).subscribe( result => { this.eventlist = this.getmanagedeventlist(result.eventinfo); }, err => { loading.dismiss(); }, () => { loading.dismiss(); } ); }
op's feedback:
this not issue of code.this issue of "ionic view" app.i have installed .apk
on android device , no issues.it's working fine.i think there huge difference between simulated environment , actual device.
original answer:
try using page lifecycle or platform resume (or both)
import { platform } 'ionic-angular'; constructor(public storage: storage, public plat: platform) { super(storage); super.gettoken().then((val) => {//get token this.token = val; this.geteventlist(this.token); }); //when use inappbrowser app paused, when go it, fires resume event plat.resume.subscribe(() => { //code list }) } // lifecycle event every time page entered (going or forth) function fired ionviewwillenter(){ //get event list } //get event list geteventlist(data): { this.eventdata.geteventlist(data).subscribe( result => { this.eventlist = this.getmanagedeventlist(result.eventinfo); }, err => { loading.dismiss(); }, () => { loading.dismiss(); } ); }
by default can use page lifecycle events without problems, throws error can try importing navcontroller
, use it.
hope helps :)
Comments
Post a Comment