Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deeplinking question / discussion #4

Open
simonmcl opened this issue Aug 31, 2021 · 2 comments
Open

Deeplinking question / discussion #4

simonmcl opened this issue Aug 31, 2021 · 2 comments

Comments

@simonmcl
Copy link

When trying to connect to a website you need to scan a QR code which has the url tezos://xxxxxxxxx. This will allow users to scan with their camera app and get a link to a wallet/app

There is an issue on iOS though, that when multiple apps request to use tezos as a URL scheme, which one will be launched is "undefined". iOS doesn't currently display a share sheet style screen to list all the apps, it just picks one. While experimenting with this library I had AirGap installed on my phone and was unable to get the QR code to launch my app, until I deleted AirGap. Relying on this as a method of opening apps is going to cause a headache for users as the number of apps grow.

Short term it would be a good idea to promote the idea that third party apps should embed their own QR scanner, it might be good for BeaconSDK to include a basic one in-built in the SDK. I'm also not sure if i missed it or not, but I found no code in the library to take a tezos://xxxxxx URL and turn it into a P2P class or even turn the data into JSON. I also couldn't find any documentation on how it was encoded or what to do with it. I had to go read the code of a website to see what they did. If such a function doesn't exist, it really needs too. If it does, it should be added to the README documentation.

Longer term, it might be a good idea to try build a website with buttons/deeplinks to whitelisted mobile apps. When the QR code is scanned with the inbuilt camera app, it would bring users to an AIrGap website, with a list of options to launch various apps from there. Hopefully it could be done in such a way that scanning with the default camera app went to the webpage, but scanning with custom in-app, would still contain the necessary data

@AndreasGassmann
Copy link
Member

AndreasGassmann commented Sep 1, 2021

I can't comment on the internals of the sdk, @jsamol will do that when she has time.

Regarding the deeplinks in general, it is indeed a very annoying situation now. The way we are doing it with beacon is the following:

  • The tezos:// deeplink is the generic and default deeplink of the QR code. This will work on iOS if the user only has one wallet installed (or he's lucky and the correct one opens), and it will also work on Android because it will trigger the system level prompt to select one of the apps that can handle the deeplink.
  • The expectation is that users will generally use the in-app scanner to scan QRs. This was never really discussed, but IIRC this seems to be the standard, also when looking at Ethereum wallets and WalletConnect.
  • For iOS, we have a list of "whitelisted" apps and their deeplinks in the typescript SDK. If you click on that specific wallet (eg. AirGap Wallet), the QR code will actually contain the app specific deeplink. If the wallet is selected on the mobile device itself, it will also trigger a deeplink with the app specific deeplink. EDIT: I just checked and the QR code doesn't actually contain the app specific QR code. I thought I did that. I'll have to fix that in the next version.

The idea of a website that acts as a "middle man" is interesting. We'll have to think about this a little more. It would probably increase usability for users who use the stock scanner on iOS and have multiple wallets installed, but it will actually decrease the usability in case the user only has one wallet (iOS), or he is on Android, because it will add an extra "unnecessary" step. It also requires our website to be up at all times and requires users to trust our website, because we could provide a malicious QR code. But on the other hand it would solve the problem of having a pairing alert with too many apps in the list.

A lot of positive and negative points, I'll have to think about it a bit more :).

@jsamol
Copy link
Member

jsamol commented Sep 2, 2021

I'm also not sure if i missed it or not, but I found no code in the library to take a tezos://xxxxxx URL and turn it into a P2P class or even turn the data into JSON.

You haven't missed anything, there's no support for deeplinks in any way in beacon-ios-sdk for now. It's been on our radar, though, and we'll get there eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants