I get some error with accessing woocommerce api "getAsync" in my ionic ios app. It says: [Error] Failed to load resource: Request header field User-Agent is not allowed by Access-Control-Allow-Headers. Fetch API cannot load https:/WEB_BASE/wp-json/wc/v2/products/categories?parent=0&consumer_key=MY_SONSUMER_KEY&consumer_secret=MY_CONSUMER_SECRET due to access control checks.
The code is running well in Android platform, also on ios 10. The error above happen on ios 11.
this.wooCommerce.getAsync("products/categories?parent=0").then(
data => {
this.categories = JSON.parse(data.body);
},
err => {
console.log(err);
}
);
With this error, I can't get the product on my woocommerce data. Can anyone help me on this?