planetary-ios icon indicating copy to clipboard operation
planetary-ios copied to clipboard

Need to test & validate auto-generated App Store ad-referrer links can properly trigger targeted screens in Planetary iOS

Open danlatorre opened this issue 3 years ago • 3 comments

On the web page of a Room OR Profile, the join/follow button contains an App store ad-referrer link which is used in-app to trigger the correct screen to a user.

So that new users are delightfully and quickly able to join/connect.

Questions:

  • How to auto-generate App store ad-referrers for each room webpage?
  • How to auto-generate App store ad-referrers for each profile webpage?
  • How to read App store ad-referrer code in-app?

danlatorre avatar Nov 23 '22 00:11 danlatorre

@mplorentz knows a bunch about how this stuff works as he's done something with it at past apps he worked on.

rabble avatar Nov 23 '22 00:11 rabble

Background

There are two different ways you can make a link open in a native iOS app: Universal Links and Custom URL Schemes. Planetary supports both already.

A Universal Link is just a normal http link that opens a normal webpage. But if you configure your website and app in a very particular way then Apple will (usually) give your iOS app a chance to handle the link instead of the web browser. You can test this out on an iOS device with Planetary installed using this link (it should open my profile): https://planetary.link/%404wXR%2FKiJrkz9D2LPXpZl5XOLw%2BgYCoJW6p6rwFlI5yA%3D.ed25519

(On a device without Planetary it should open a webpage showing my profile, but the planetary.link web viewer is not working atm).

A URL scheme is a custom link that will only work if you have an app installed that supports the link (they also don't work well if you have multiple apps that support the link. See #996). We have one for Planetary which looks like this: planetary://profile/%404wXR%2FKiJrkz9D2LPXpZl5XOLw%2BgYCoJW6p6rwFlI5yA%3D.ed25519

There is also a more generic SSB URL scheme that is supported by several SSB apps. We support a small subset of it for room invitations, and we have #382 for the rest.

I'm not sure of your exact definition of ad-referrer links. I think of links used in ad campaigns that use query parameters to trace the opening of a webpage or installation of the app back to particular ad campaign. I don't think this sort of tracing is needed here, but correct me if I'm wrong. It's pretty difficult and error-prone to do for iOS apps because Apple actively tries to prevent this type of tracking.

Implementation

I think ideally our room servers would use the SSB URI scheme as it should have the widest support among various SSB apps. However #996 must be solved before we go down this route. Maybe the planetary:// URL scheme will be part of the workaround.

It might not be a bad idea to use Universal Links in addition to the SSB URI scheme since the Universal Links will only work for Planetary users and gracefully degrade to a webpage for everyone else. It would look like like this:

  • I share a Universal Link to my profile with a friend that looks like this: https://planetary.link/%404wXR%2FKiJrkz9D2LPXpZl5XOLw%2BgYCoJW6p6rwFlI5yA%3D.ed25519
  • If they have Planetary installed it will automatically open in Planetary.
  • If they don't have Planetary they will be taken to the webpage. The webpage could have a button on it that says "Open in SSB" which uses the SSB URL/URI scheme to open in the SSB app of their choice
  • If they don't have an SSB app we should show a CTA on the page explaining how to get one.

This flow is pretty similar to the way go-ssb-room invitations and aliases work already, just without the Universal Link part.

mplorentz avatar Nov 30 '22 16:11 mplorentz

Based on yesterday's chat @mplorentz I'm moving this to the backlog. Because doing this will require a 3rd party service for these deferred deep links.

danlatorre avatar Dec 21 '22 21:12 danlatorre