Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49236

Unknown Error, Status code: 0, Issue with Ionic 4 when testing on Android

$
0
0

While Testing my app on a device I always get this error

CORS enable at your server-side Have also tried all the solutions available here none of this work.

Function Calling API

import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { environment } from '../../environments/environment';

@Injectable({
    providedIn: 'root'
})
export class ApiService {

    constructor(private http: HttpClient) { }
    async checkPhone(phone: string, hash: string) {
        console.log("value of phone inside checkPhone Function " + phone);
        let data = { "phone": phone, "hash": hash };
        let headers = new HttpHeaders({
            'Content-Type': 'application/json'
        });
        let options = {
            headers: headers
        }
        return await (this.http.post(environment.endpoint + "/users/register-phone", data, options)).toPromise();
    }
}

Config.xml Access is allowed

<access origin="*" />
  <allow-intent href="http://*/*" />
  <allow-intent href="https://*/*" />

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 49236

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>