AlphaWallet / alpha-wallet-ios

An advanced Ethereum/EVM mobile wallet
https://www.alphawallet.com
MIT License
592 stars 364 forks source link

Wallet connect request with Local Notifications #3747

Open oa-s opened 2 years ago

oa-s commented 2 years ago

It would be greate if to use local notification for wallet connect requests, in case if the app in backgroud. To notify user about incoming request

hboon commented 2 years ago

Sounds useful. So request background time if there’s an active WalletConnect session? Want to try it out?

Actually without this, what happens if the app is suspended, an incoming request and the app is resumed? Is it queued?

hboon commented 2 years ago

But wait. Doesn’t the universal link for AlphaWallet get triggered and the apps switched to for signing requests?

oa-s commented 2 years ago

Sounds useful. So request background time if there’s an active WalletConnect session? Want to try it out?

actually don't know for now, it needs to check.

oa-s commented 2 years ago

But wait. Doesn’t the universal link for AlphaWallet get triggered and the apps switched to for signing requests?

it the app get triggered by universal link (and its in suspended state) it still should process the universal link, and open approproate screen.

oa-s commented 2 years ago

so yes, we need to check if there is connection for socket with WalletConnect

hboon commented 2 years ago

But wait. Doesn’t the universal link for AlphaWallet get triggered and the apps switched to for signing requests?

it the app get triggered by universal link (and its in suspended state) it still should process the universal link, and open approproate screen.

Oh of course! The user wouldn't know to check their phone I guess, even if the app is triggered via Universal Link. Yes, good to explore this.

oa-s commented 2 years ago

Close due to disconnection web socket on entering background:

@objc
    private func appDidEnterBackground() {
        wakuRelay.disconnect(closeCode: .goingAway)
    }
hboon commented 2 years ago

@oa-s can we request for background time and delay calling disconnect() until background session is expiring?

Do close if it's concluded after this.