Failed to load the JS script of the agent
RizwanAliGujjar opened this issue · 6 comments
Hello. We're constantly getting this error in Android Build
Error: Failed to load the JS script of the agent
We're on versions "@fingerprintjs/fingerprintjs-pro-spa": "^1.0.2"
Note* No VPN no Ad Block.
This error occurs when I call it's Init Function
import { FpjsClient } from '@fingerprintjs/fingerprintjs-pro-spa';
const fpjsClient = new FpjsClient({
loadOptions: {
apiKey: "your_Api_key" // insert your public api key from the dashboard here
}
});
const visitorData = fpjsClient.init().then(() => {
console.log("Ok ");
}).catch((error)=>{
console.log("Error :: "+ error);
});
Can you provide info about your browser? Version, operation system?
Also, is this link available from your network? https://fpnpmcdn.net/v3/<your_Api_key>/loader_v3.8.2.js
@ilfa Yes it is available
I'm using Android Mobile version 7.0.
and I'm not testing it on chrome or any browser. I created apk from cocosCreator
@RizwanAliGujjar have you inserted your public API key to the URL instead <your_Api_key>
before testing?
Do you use cocosCreator
because you are writing app with javascript? Because we have an Android agent that is more effective for Android apps.
Does cocosCreator
allow to run code like document.createElement('script')
and document.appendChild
to manipulate the DOM and load additional scripts? If not, it is not compatible with using our JavaScript Agent
@ilfa I have check it and it's opening on my mobile browser and I have replace the api key
So problem is not on the network side.
I checked cocosCreator
documentation and it said: Plugins that rely on the DOM API will not be able to publish to the native platform
Our JS Agent needs a browser DOM API for work.
I recommend you to use native agents for Android and for iOS
I found this example that says that it is possible.
We use the native agent approach in our Flutter and React Native SDKs.