I'm using ionic3 to build E-commerce app with Wordpress as a backend. I'm using Woocommerce api to get products, orders, ect. this my code to configure it
import * as WC from "woocommerce-api";
Woocommerce = WC({
url: this.url,
consumerKey: this.consumerKey,
consumerSecret: this.consumerSecret,
wpAPI: true,
queryStringAuth: true,
version: "wc/v2"
});
let query = "products?" + "page=" + this.page;
if (this.selected != "") query = "products?page=" + this.page;
query = query + "&status=publish" + "&" + this.config.productsArguments;
this.config.Woocommerce.getAsync(query).then((data) => {
console.log(data)
})
It worked on android Well but on Ios i have this error :
https://testsite.com/wp-json/wc/v2/products?include=2047%2C1828%2C1768%2C1767%2C1766%2C1765%2C1763&status=publish&order=desc&orderby=date&lang=en¤cy=EGP&consumer_key=ck_xxxxxxxxxxxxxxxx&consumer_secret=cs_xxxxxxxxxxxxxxz Failed to load resource: Origin httpsionic://localhost is not allowed by Access-Control-Allow-Origin.