Devlog: February 14, 2023

I woke up around 2am and couldn’t sleep. So decided to finish up some work on adding an App Clip to ScreenCred. Since the app is fairly limited in functionality, pretty much all of it can be included in the App Clip. I wanted to do this to go along with sharing links. If you share a link with someone who does not have the app installed, they should see the App Clip card in messages.

The docs for App Clips are actually pretty good. You have to click around a lot to find everything, but I was able to find 99% of what I needed in the official docs. I think I have this all setup correctly—and I’ve tested it as best I can on TestFlight—but kinda seems like you can’t be 100% sure until the app is released.

But, I think it’s mostly working. The cards in iMessage now have an open” button on them!

An iMessage card showing a link to the ScreenCred app, with a button to open in the appPretty button!

The App Clip will respond to the same URLs that I setup for universal links. The main difference between the app and the App Clip is how they handle the URL. In SwiftUI, the app uses .onOpenUrl, but the App Clip uses .onContinueUserActivity:

.onContinueUserActivity(NSUserActivityTypeBrowsingWeb) { activity in
    guard let url = activity.webpageURL else { return }
    viewState.handleUrl(url)
}

It took me a bit to find that NSUserActivityTypeBrowsingWeb is what you want to pass in as the string1.

I’ve only seen one or two App Clips out in the wild, so not totally sure how they are supposed to work. I guess I could read some human interface guidelines and whatnot, but I kinda feel like wingin’ it.

I think I need to give my brain a break for a few days. I’ve been really excited about working on ScreenCred, but it’s been taking over a bit. Need to slow down a bit. I just get so obsessive when I’m learning new technologies like universal links and App Clips, that it’s hard for me to stop until it’s all done. The goal of this is to learn how to make an app in a sustainable way, and I’m starting to see the signs that I’m moving too quickly.


  1. Would that be so hard to put right in the docs?↩︎



Date
February 14, 2023