In Ionic 3 Angualar 5 application. The below MVC call is failing in Android 7 and above works fine in Android 5. Any guess why?
> import { HttpClient } from '@angular/common/http';
>
>
> ```
> > constructor(private http: HttpClient) {}
> > .........
> > .........
> > > this.http.post('http://www.mymvcsite.com/controller/action' +'?param1=val1¶m2=val2¶m3=val3', null).pipe(
> > > map(this.extractData),
> > > catchError(this.handleError)
> > > );
> ```
I am in doubt that because the site is insecure (http not https) the upgraded android versions must be preventing the call, but not sure if that is the cause, I am not android programming expert, please help.
Use angular observable instead http plugin.
Thanks can you please suggest a sample code
sure i will share example. can i know in which platform are you facing problem like browser or android or ios?
The code failed in Android version 7. The same code worked fine in Android 5 and while tested in chrome using >ionic serve command
I have checked one of the sample code https://scotch.io/tutorials/angular-2-http-requests-with-observables my code uses @angular/common/http instead @angular/http
Your are using right one.
can you post any error log, which you are getting in android version 7?
Unfortunately I don’t have this android version in my test environment, I could notice only in the production right now, ionic simulator only simulates cordova version, for simulating specific android version i need to use android studio. can I execute the generated .apk in android studio emulator?
without error log how can we assume what is exact error.
Hi,
I have the same issue in android version 6 above.
Following error i am getting when i call the rest api with https secure url.
Extract the apk in debug mode and check the error from devTools. Or share with us.