Experimenting with AIOHA package & trying to integrate it in flutter project
13 comments
Hello
Saw your annoucement that now you are
& was april-fooled for almost 1 hour 🤣
Realized only after reading comments
Understanding Setup
Let's get to the subject. I am experimenting with AIOHA & trying to integrate it in Flutter project. As you know that, flutter project supports multiple platforms. My flutter project intends to support web, iOS & Android. To start with, I'm focusing on web support.
Here is how flutter-web-app folder structure looks like.
I have added following script tag in body.
<script type="module">
import * as Aioha from "./aioha@1.6.0-beta.4.js";
window.Aioha = Aioha;
console.log("Aioha initialized", aioha);
aiohaInitialized = true;
</script>
In another script tag, I've added following code to make sure that I access AIOHA only after it is available.
var aiohaInitialized = false;
let aioha = null;
async function someFunctionToUse(some, params) {
if (!aiohaInitialized) {
console.error("Aioha not initialized");
// try again after few miliseconds when aioha@1.6.0-beta.4.js is available/downloaded
return;
}
if (aioha === null) {
// we have aioha.js, let's set up an aioha instance
aioha = window.Aioha.initAioha({
hiveauth: {
name: "AiohaExperiments",
description: "Testing aioha login - keychain & hiveauth methods",
},
});
}
// we are good to go to use aioha
}
Understanding Error
HiveKeychain based login works very well & I didn't face any error. However, HiveAuth started giving me error.
So, when I tried logging in with HiveAuth, I got error.
Error from console
Network Tab from Chrome Inspector
Next Steps
- I request to look into this issue.
- I assume by bundling together, we can avoid that issue. I'm not js/front-end expert here so may be I am wrong.
- Once, this issue is solved, I'll switch to iOS & Android integration
❤️ Love the work I do, support
& me ❤️
Comments