I am having issue in BuildFire that works on my local computer but fails in production when the plugin is uploaded.
In my plug-in, I am having the user enter and save values to the buildfire local storage as such in my Content.js:
function saveCredentionals (){
buildfire.localStorage.setItem("bw_organizer_id", organizer_id, (error) => {
if (error) return console.error("something went wrong!", error);
console.log("All is well, data saved and other plugins can now access it");
});
buildfire.localStorage.setItem("bw_access_token", access_token, (error) => {
if (error) return console.error("something went wrong!", error);
console.log("All is well, data saved and other plugins can now access it");
});
}
The files save correctly and values can be retrieved in the Content.js, even when page reloads. Next I try to retrieve the values in Widget.js as such:
Promise.all([
buildfire.localStorage.getItem("bw_organizer_id"),
buildfire.localStorage.getItem("bw_access_token"),
]).then(items => {
let has_organizer_token = false;
let has_access_token = false;
if (items[0]) {
has_organizer_token = true;
}
if (items[1]) {
has_access_token = true;
}
if (has_access_token && has_access_token) {
displayVideoPage(items[0], items[1]);
} else {
setMainContent(<div>Organizer ID and access token required.</div>);
}
});
This works on my local computer but fails to retrieve the value when I publish my plugin and run it on the app.buildfire.com . The items from the Promise are both null on production in my Widget.js.
Any thoughts on why this is happenings? The code is also open sourced here: https://github.com/BingeWave-Libraries/buildfire-livestream