AIOHA + Flutter - Plugin - facing issues with web-app

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@sagarkothari88·
0.000 HBD
AIOHA + Flutter - Plugin - facing issues with web-app
Hello People on Hive,

AIOHA based flutter plugin for iOS & Android App is working fine but for web-app, it is giving me several errors & to be honest headache as well 🥺

### Javascript won't load

![Javascript won't load](https://files.peakd.com/file/peakd-hive/sagarkothari88/EqqxHA7HxtrPds52RNECfEeCpqa7TRnMj8qMu28D8PBZMnmENX2xn3brvcgq9cr9HHg.png)

At first, javascript it self won't load from plugin. If I add it directly into the project, it works fine. but If I do it via plugin, it simply won't work. On App side, script won't appear inside html as illustrated above.

### Injection using iFrame

![Injection using iFrame](https://files.peakd.com/file/peakd-hive/sagarkothari88/EqqxJtE1cBTpcSLnhFo6iGRa5RSwP6Mtk9iQgskknFe7m293CL9GEwg1eWfTbhsBqQD.png)

So, I managed to inject using iFrame from flutter-plugin & it would appear in the example application's web-app. However, js won't execute. javascript under that iFrame simply won't execute most probably due to safety reasons. 

### Injection using Div

![Injection using Div](https://files.peakd.com/file/peakd-hive/sagarkothari88/246b4uXX98FW5nbABpGsFiyJV9vy9jPm8MQBv9w3EhKCUC95Z1uJGxFTnJnSDFmANhSat.png)

After looking for options, I found div based injection. That to worked but javascript won't execute :(

### Only if App uses JS directly


![Only if App uses JS directly](https://files.peakd.com/file/peakd-hive/sagarkothari88/23tkhxz2Jsgse5W2QnYYGYyoq3JeKWfCCH8GoyLQgufsApXx4eCDFk3SGbFpr1vuopWEs.png)

it works only in this scenario - Example app must update it's HTML & bring js inside it.
but that's not how plugin works. Manual drag & drop - isn't considered plugin
However, at the moment, this manual drag & drop / copy-paste works


![manual copy paste works](https://files.peakd.com/file/peakd-hive/sagarkothari88/48dSvwgU9hjoeq5JQx9cGt2kqbfnyuXg2kuJETT5r5PQFK8vq2WX36HYKLNb6YkcxC.png)

As you can see in the screenshot above, manual copy-paste in html works well. But as I said, it's not the expected solution for a plugin. 

### Goal

My Goal is that, any developer, who uses this package, just specify the name of package & start using it & it shouldn't require any manual copy-paste. However, I am far from that goal, at least for web-app. I am trying to achieve it.


### Next Steps

- ✅ iOS - HiveAuth integration
- ✅ Android - HiveAuth integration
- ✅ Upvote, Comment, Reblog, Follow, Unfollow etc
- ⏳ Build a plugin so that we can use it in any internal application

-----

❤️ Love the work I do, support @threespeak & me ❤️

<center>

[![Support @sagarkothari88](https://images.hive.blog/u/sagarkothari88/avatar)](https://witness.the-hive-mobile.app/#/witnesses/@sagarkothari88)
### [Vote sagarkothari88 as Hive Witness](https://witness.the-hive-mobile.app/#/witnesses/@sagarkothari88)

[![Support @threespeak](https://images.hive.blog/u/threespeak/avatar)](https://witness.the-hive-mobile.app/#/witnesses/@threespeak)

### [Vote for 3Speak as Witness](https://witness.the-hive-mobile.app/#/witnesses/@threespeak)
<br/><sub>Uploaded using 3Speak Mobile App</sub>

 
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,