5afe / safe-react

Deprecated! New repo – https://github.com/safe-global/web-core
MIT License
332 stars 363 forks source link

Open links in mobile App #3003

Open anxolin opened 2 years ago

anxolin commented 2 years ago

Overview

Part of #2998. Related to #970

As a mobile user using a mobile browser, I want, that if I click on a link for Gnosis Safe Web, then this link would open in the Gnosis Safe app (if installed) so I can get a native experience if available

This is related to #970. Specifically, CowSwap creates links to the Gnosis Safe transaction, so users can sign it. it would be nice that if clicked in my IOS phone it would open Gnosis Safe IOS app instead of Gnosis Safe web app.

Goals

Provide a better mobile experience.

Requirements

Open native app if available for links. Specially the one that opens the transaction details (see #970)

Note: this will only work on iOS! 📱

Implementation

katspaugh commented 2 years ago

@DmitryBespalov could you share the mobile app ids so that we can enable a smart banner?

Also, if I'm not mistaken, @anxolin could use a deep link that would go directly to our mobile app on the phone but fall back to web on desktop? I think it's called a deep link, e.g. gnosis-safe://transactions?

DmitryBespalov commented 2 years ago

This is already possible on iOS with universal links, i.e. when you open the link to the host https://gnosis-safe.io/..., it will open first in the browser and if you have your app installed, you'll see a banner in the top allowing you to open the link in the app. Then, all the links will open in the app.

If you want to have it so that the app opens specific screen (transaction details), we need to implement that, but just opening the app would be possible already.

Also, as @katspaugh said, you can open the app directly via deep link but this does not handle the case when there's no app installed on the phone, i.e. the link will not work.

Let me cc @sche to this conversation.

katspaugh commented 2 years ago

So what is our app-id?

Also what is the name of the deep link?

DmitryBespalov commented 2 years ago

Added to this doc: https://docs.google.com/document/d/17lS-C6B3M5x7CRk2MBd39qaLntxO3tCXtmlUp1jmB-E/edit?usp=sharing

anxolin commented 2 years ago

Thanks for all the responses.

This is already possible on iOS with universal links, i.e. when you open the link to the host https://gnosis-safe.io/..., it will open first in the browser and if you have your app installed, you'll see a banner in the top allowing you to open the link in the app. Then, all the links will open in the app.

Alright, then it should work already with our current version. Our QA mentioned that it was not, but I will test it now.

If you want to have it so that the app opens specific screen (transaction details), we need to implement that, but just opening the app would be possible already.

Not sure i follow, I understand that if I send the user to https://gnosis-safe.io/app/eth:ADDRESS/transactions/queue the user should be able to open the queue of that safe in IOS if they click the banner on the top of the web

DiogoSoaress commented 2 years ago

I am testing in PROD, when we open a universal link (https://gnosis-safe.io) in iOS Safari (I am testing in the iPad we have in the office), the link is NOT opened in the Gnosis Safe app. However, by searching in Google by "Gnosis Safe" and opening the indexed link it opens in the Gnosis Safe app.

For Android, none of the links (https://gnosis-safe.io OR from the Google search OR https://gnosis-safe.io/app/rin:0x1993EE88631821f310c0877faB3eefe421949752/transactions/history) opens in the installed Gnosis Safe App.

Can you please confirm this is the current behavior @gnosis/mobile-devs ?

DmitryBespalov commented 2 years ago

Hi @DiogoSoaress, in order for the link to open directly on iOS Safari, you need to first open it in Safari, scroll to the top, and click on the "Open" button in the smart banner, did you do that already? This then will open this and next time in the app.

Android will be as is for the time being, please use iOS as the main app for testing.

However, please bear in mind we didn't implement the linking to a specific screen via universal link yet

DiogoSoaress commented 2 years ago

Thank you for further explanation @DmitryBespalov .