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.

AIOHA HiveAuth Login

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.

Handling error cases

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

index.html as an asset to flutter project

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.

HeadLess In-App-WebView

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.

Handler Based approach for executing js from dart

Final Working Output

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 ❤️

Support @sagarkothari88

Vote sagarkothari88 as Hive Witness

Support @threespeak

Vote for 3Speak as Witness


Uploaded using 3Speak Mobile App



0
0
0.000
6 comments
avatar

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.

0
0
0.000
avatar

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.

image.png

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.

0
0
0.000
avatar

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.

2.png


Invest in the Lu token (Lucoin) and get paid. With 50 Lu in your wallet, you also become the curator of the @hive-lu which follows your upvote.
Buy Lu on the Hive-Engine exchange | World of Lu created by szejq

If you no longer want to receive notifications, reply to this comment with the word STOP or to resume write a word START

0
0
0.000