AIOHA + Flutter Bridge - HiveAuth - vote, follow, unfollow, comment, etc need payload to redirect

in HiveDevs3 months ago

Hello @techcoderx,

As you know, I am implementing AIOHA in flutter application.
So far, it's going great. I really appreciate the work you've done & I am finding this package/library very very useful. I am building a flutter-wrapper-package around it for internal usage.

Implemented

So far, I have implemented followings with AIOHA

  • login with HiveKeychain
  • login with HiveAuth
  • login & sign a message with HiveKeychain
  • login & sign a message with HiveAuth
  • log out
  • switch user
  • show current user
  • show list of logged-in users
  • remove a user
  • sign a message

Issue encountered when implementing Vote

So, right after implementing above features, I started implementing one of the commonly used feature - VOTE. Initially, I thought, it won't be any different than what I've implemented so far but I was wrong.

Tapping on Vote, I execute following aioha based javascript

const result = await aioha.vote(author, permlink, weight);

However, to user it shows nothing on application & user knows nothing about what aioha is doing behind the scene.

So, out of curiosity, I tried switching to keychain application manually, and then I realized something is missing.

only after switching to keychain

So, upon tapping on vote, I should get payload like we are already getting it for sign transaction.

generating payload

sign transaction payload

Just like that, we'll need payload for all of these actions like - vote, follow, unfollow, comment, etc.

If we get payload, we'll be able to redirect to any PKSA application (HiveKeychain or HiveAuth app) to approve transaction. Even though, transactions are white-listed, sometimes if app is in background for very long, socket connection may be disconnected. OR in some cases, PKSA app may not be running at all. That's why, getting payload is crucial as a app-launcher-url.

Once it's in place, we'll be able to launch PKSA app without any issue like shown below

PKSA App launcher payload needed

Next Steps

  • ✅ iOS - HiveAuth integration
  • ✅ Android - HiveAuth integration
  • ⏳ Build a plugin so that we can use it in any internal 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

Sort:  

Great progress on AIOHA in Flutter! 🎉 The HiveAuth vote/comment payload redirect sounds tricky, hope you solve it! 👍

It's actually very easy as the event handler only need to be specified once for the whole app rather than repeating the code in every signature request.

aioha.on('hiveauth_sign_request', (payload: string, evt: MessageType, cancel: () => void) => void)

Yes @techcoderx
Noted. I am not going to add it for every request, I'll have it once for entire app.

Well done 👍