AIHOA based login with HiveAuth & Sign a message - works well with iOS App now
Hello Everyone,
With this post, I would like to share that AIOHA based login with HiveAuth on iOS application is done.
Of course, above code / function is partial. Here is the other half in which I have handled edge cases like if user has already logged in, if user cancelled signing-in etc.
At the end, I am also sending the proof which was signed. This can be used by backend to verify & issue JWT token.
So, I have above function in index.html file which I've added as an asset of flutter project as indicated below
Now, I load this HTML file with headless in-app-webview & using that webview I can run javascript within application at any given point of time.
I didn't find solution at first & kept getting either errors or null results. Finally after having lot of back & forth with ChatGPT 🤣, we finally decided to implement handler based approach to execute javascript & get result from js to dart/flutter app.
Final Working Output
Finally, we are getting a success callback after scanning QR code which is passed to flutter app & flutter app shows above message at the moment.
Next Steps
- ✅ iOS - HiveAuth integration is done
- ⏳ Android - HiveAuth integration is in progress
- 💻 Build a plugin so that we can use it in any application
- 💻 Upvote, Comment, Reblog, Follow, Unfollow etc
❤️ Love the work I do, support @threespeak & me ❤️
Vote sagarkothari88 as Hive Witness
Vote for 3Speak as Witness
Uploaded using 3Speak Mobile App
It would be preferred to use
errorCode === 4901
to check for existing logins instead of checking the error string. This way you may use it to display a localized error message to the user.The full list of error codes may be found here.
Understood @techcoderx
I'll update my code accordingly
via Inbox
This post has been manually curated by @bhattg from Indiaunited community. Join us on our Discord Server.
Do you know that you can earn a passive income by delegating to @indiaunited. We share more than 100 % of the curation rewards with the delegators in the form of IUC tokens. HP delegators and IUC token holders also get upto 20% additional vote weight.
Here are some handy links for delegations: 100HP, 250HP, 500HP, 1000HP.
100% of the rewards from this comment goes to the curator for their manual curation efforts. Please encourage the curator @bhattg by upvoting this comment and support the community by voting the posts made by @indiaunited.
thank you so much @bhattg & @indiaunited for curation.
Lots of love
Have a good day.
via Inbox
Well done 👍
Hello sagarkothari88!
It's nice to let you know that your article will take 11th place.
Your post is among 15 Best articles voted 7 days ago by the @hive-lu | King Lucoin Curator by keithtaylor
You receive 🎖 0.4 unique LUBEST tokens as a reward. You can support Lu world and your curator, then he and you will receive 10x more of the winning token. There is a buyout offer waiting for him on the stock exchange. All you need to do is reblog Daily Report 642 with your winnings.
Buy Lu on the Hive-Engine exchange | World of Lu created by szejq
STOP
or to resume write a wordSTART