Hi,
I’m implementing Y8 login system in my game. Following the JS Quickstart documentation, I have added code like this:
<script>
var authCallback = function (response) {
if (response) {
console.log("[Y8] Login complete");
console.log(response, response.authResponse.details);
}
}
window.idAsyncInit = function () { // SDK downloaded
ID.init({
appId: '6xxxxxxxxxxxxxxxxxxxxxxxxx0'
});
ID.Event.subscribe('id.init', function () { // SDK initialized
console.log("[Y8] SDK initialized");
ID.getLoginStatus(function (data) { // Try Autologin
console.log("[Y8] Login status: ", data);
if (data.status == 'not_linked' || data.status == 'uncomplete') {
ID.login(loginCallback); // Connect/Request permission
} else {
// Not logged in
}
});
ID.Protection.isBlacklisted(function (blacklisted) {
console.log("[Y8] Is site blacklisted: ", blacklisted);
});
ID.ads.init('6xxxxxxxxxxxxxxxxxxxxxxxxx0');
});
};
</script>
<script src="https://cdn.y8.com/api/sdk.js" async></script>
But the issue is that:
ID.Event.subscribe('id.init', function () {
// SDK initialized
console.log("[Y8] SDK initialized");
});
This is never called. There are no logs in the console related to this. It looks like the SDK is not initialized.
Has anyone else faced this issue before? What is the problem here?