Hi
I need to get country so that I can localise my game automatically.
I tried two methods
First
pc.http.get("https://api.country.is", { "retry": true, "maxRetries": 5,json:true}, function (err, response) {
console.log("Country response= "+response.country);
});
Second
fetch('https://api.country.is')
.then(response => response.json())
.then(function (response) {
console.log("My Country is = " + response.country);
}.bind(this));
And both these methods I got the following error
Refused to connect to ‘URL’ because it violates the following Content Security Policy directive
Please suggest another method or suggest solution to above Error
Thanks