0

I have a question about this code:

I'm using this function for get data from ws. Communicate with ws is in https.

public detailsuser(): Observable<Users> {
              return this.http.get(Api.getUrl(Api.URLS.details), 
           {
            headers: new HttpHeaders({'X-Token': this.currentUser.token}),
            observe: 'response'
           })
                .pipe(map((response: HttpResponse<any>) => {
                    console.log('response', response);
                    return response.body.map(data => {
                        return new Users(data);
                    });
                }));
        }

This function works good in Android < v9

I try this project to run in Simulator Iphone 6 , but this function doesn't work. Show

'name': HttpErrorResponse 'message': Http failure response from https://www.............../details

Can you share with me any idea please, what happens in IOS?

Alon Bi
  • 83
  • 6
  • Possible duplicate of [Nativescript: HTTP failure response for unknown URL](https://stackoverflow.com/questions/54018049/nativescript-http-failure-response-for-unknown-url) – Manoj Aug 14 '19 at 11:07
  • My problem is for IOS, not in Android. In android works good – Alon Bi Aug 14 '19 at 11:22
  • Sorry, I'm confused when you specifically mentioned "This function works good in Android < v9". Anyways did you adjust `NSAppTransportSecurity` in info plist to support Http calls. – Manoj Aug 14 '19 at 11:24
  • Yes I put it `NSAppTransportSecurity NSAllowsArbitraryLoads ` but error exist – Alon Bi Aug 14 '19 at 11:33
  • That should do. But without a Playground Sample I may not able to comment on this further. – Manoj Aug 14 '19 at 13:40

0 Answers0