Open rolznz opened 5 months ago
Let's try to recreate this experience with Lightning: :100:
I successfully added NFC functionality on Android by integrating the HCE library and implementing NDEF messages. The library has a minor bug, which can be resolved with a simple Java code adjustment. This functionality enables invoice requests to be sent from the host phone to the payer’s phone. Here are the main points:
If you proceed with tag emulation, Alby Go would also need to handle its own/or the standard URI schema. However, this solution isn’t cross-platform, as iOS doesn’t support NFC tag emulation at this time, as my knowledge. (Probably can read by can't emulate)
If Alby Go can support the lightning URI schema, I am open to contributing this NFC functionality. What are your thoughts on adding this type of support?
Hi @calganaygun , we already support the lightning URI schema.
But this would need to be implemented through expo/react native. It seems like support was added to do it in expo, just maybe not possible to test in expo go (not sure if this is still the case)? (https://expo.canny.io/feature-requests/p/nfc)
Hi @calganaygun , we already support the lightning URI schema.
@rolznz Oh my bad, yes it looks like the URI schema is already implemented. (Somehow WoS made itself default). So, I can open a PR in a few days with the NFC HCE implementation.
Already wrote the implementation, working just fine. Just wanted to make the calls and emulation robust, Before the PR :)
Btw, I am not using Expo Go. Since, NFC needs more native needs switched to development builds :)
@calganaygun great! as long as it uses the native libraries so we do not need to eject. I don't think we want to eject from Expo as this increases the complexity significantly
@calganaygun Awesome, looking forward to your PR! :muscle:
⚡ First sats received via NFC in Go (from go to go)! Gonna open a draft PR tomorrow!
Would it be good to add iOS support as well even if it's less capable (e.g. receiving payments only) like it does with WoS? but this would be a completely different implementation?
@rolznz Receiving or sending? I am emulating an lightning URL via NDEF tag standart. So, Android can broadcast any URL to the near device. lightning:INVOICE (or address) broadcasted now, and the receiver (iOS in this case) can get this invoice info and pay it. But can't broadcast itself lightning address or any invoice. So, iOS can send sats to nearby Android device. But, It can't receive in this implementation.
@calganaygun ah. In WoS on iOS, it's the opposite as far as I know - it can receive payments via NFC, but not send them (I need to double check this).
@rolznz Update from my side: LNURL-withdraw vouchers can probably accomplish this. So, an android device can share withdraw voucher to the iOS. And, iOS can receive this voucher. Is it currently supported by the Go to create a voucher?
Or something like an additional service to claim sats from the holder. For example Bolt service WoS supports it.
If Alby supports/creates a service like this, it can be used to create passive NFC cards too. Like a debit card. (I think very accomplishable via NWC, an NWC connection can be stored in a card.)
For example a card with 1 year validity (exp. time for the debit cards). And monthly budget with 10k sats (like a virtual card budget). With the example scope:
The PoS app will read the NWC connection from the card, and send the amount to the PoS account.
@calganaygun we are working on an NWC based LNURL server: https://github.com/getAlby/lite
This could possibly support bolt cards, one day (we need to deploy it properly first) :rocket:
But my main concern was just that we have something for both Android and iOS (rather than only Android). But maybe Android only is a first step? CC @reneaaron
Not sure this is easy to do with expo?