Calm Intentions with Alaina Kafkes - podcast episode cover

Calm Intentions with Alaina Kafkes

Dec 03, 202326 minEp. 167
--:--
--:--
Listen in podcast apps:

Episode description

Alaina Kafkes from Calm joins us to talk about implementing App Intents and what she learning about her experience. Also special announcement regarding a certain app I've been working on.

Guest

Pre-Order Bushel Today! Release Date December 15!

Related Episodes

Related Links 

Social Media

Email
[email protected]
GitHub - @brightdigit

Twitter
BrightDigit - @brightdigit

Leo - @leogdion

LinkedIn
BrightDigit

Leo

Instagram - @brightdigit
Patreon - brightdigit

Credits

Music from https://filmmusic.io
"Blippy Trance" by Kevin MacLeod (https://incompetech.com)
License: CC BY (http://creativecommons.org/licenses/by/4.0/)

  • (00:00) - Pre-Order Bushel
  • (01:03) - Intro and Public Speaking
  • (02:45) - What are App Intents?
  • (06:47) - Why App Intents
  • (11:16) - Coding Challenges
  • (17:21) - Components of App Intents
  • (21:24) - Multiplatform and Last Thoughts
Thanks to our monthly supporters
  • Maurizio Bracchitta
  • Edward Sanchez
  • Satoshi Mitsumori
  • Steven Lipton
★ Support this podcast on Patreon ★

Transcript

Leo Dion (intro): Hello folks. If you've been following me for the last couple years, you know what I've been working on. Today I'm about to unveil the final piece of that puzzle. It's Bushel the Mac OSS virtual machine app designed by developers for developers. You've seen it grow and now it's ready to revolutionize your app development process. With bushel, you have the power to snapshot and roll back your machine effortlessly. Just like saving your game process.

It's the tool you've been waiting for. No more compatibility worries. Bushel lets you explore diverse MAC OSS versions and configurations, ensuring your app's flawless performance. The weight is over. Bushel is now available for pre-order, so get ready to unlock the ultimate app development experience. Save the date bushel drops on December 15th. Continuing our journey together in redefining app development, pre-Order today and let's build something incredible with Bushel.

Your support has brought me this far and I can't wait for what's ahead. Thank you and enjoy the rest of this episode. I.

Leo DionLeo Dion

Welcome to another episode of Empower Apps. I'm your host, Leo dn. Today I'm joined by Elena Kafkas. Elena, thank you so much for coming on. Alaina Kafkes (guest): Ah, thank you for having me, Leo. It's cool to get to chat with you and I think this is the first, I think maybe the first iOS podcast I've ever been on. So exciting for me as well. yEah, I was really excited to have you on. It's a topic I've been interested in was today's topic, which is app intents.

Read your article about your work at Calm. But before we begin, I'll let you go ahead and introduce yourself. Alaina Kafkes (guest): Yeah, sure. So, I am a senior software engineer at Column right now, and I, throughout my career have like primarily focused on iOS, which has been. Very cool. I honestly feel like it was something that I fell into and I feel incredibly lucky to have done.

So, I guess besides working, I feel like my outside of, not like a, not like a passion project, but I find it fun to go speak at conferences. So you might see me on like the iOS conference circuit, or you might have already, if you're around. Any future conferences you're gonna be at? Alaina Kafkes (guest): No, but I'm like contemplating 2024. Yeah. Yeah. I've. Alaina Kafkes (guest): want to do yet, but I'll think about it like very soon. Yeah. Yeah, it's a great experience.

I love speaking at conferences. I think I will be speaking at least one conference next year I know of. So, be on the Alaina Kafkes (guest): that's exciting. But yeah, it is exciting. But yeah yeah, it's a great experience. I highly recommend people give it a shot and fill out a CFP. Yeah. So let's talk about APP and let's jump right into it. First of all, what are app intents? Maybe let's start with that before we jump into the why. Alaina Kafkes (guest): That is a good question.

So app intense is a framework. It was released by Apple in WWDC 2022. And as Apple phrases, it, it is a programmatic way to make your app's content and functionality available to system services. So my read of that sort of Apple speak is basically it allows users or app intents are a way to allow your users to take an action within your app using something like Siri or the Shortcuts app Spotlight, and then also like the action button on some devices.

And like a good example would be like if you say like, Hey Siri, do X, like that might be invoking an app intent. Yeah, so it's kinda like. How do I put it? It's, it's a, it's a framework which upon you could like do other things such as Siri.

The one that I keep thinking of is when I constantly accidentally turn my wrist on my watch and it shows me the calendar, and then I'm on my Mac and it says, Hey, by the way, you're has the little thing at the bottom, you know, in the dock where it shows calendar watch. And I'm like, yep, that's right. I did accidentally load up my watch. So yeah, that's, that's what I'm familiar with. But why?

Why kinda, what was the maybe business decision, I don't know how much you're gonna answer this, but how much was it of a business decision? Was it to be like, Hey, let's do app intense for calm. What? What was the thought process on that? Alaina Kafkes (guest): Yeah, that's, that's a good question. So I feel like calm chose to pursue creating app intents. Actually, I'm gonna rephrase a little bit. So Calm had pre-existing Siri kit intents, but we actually implemented them wrong.

That's my understanding after working on this project. So we ended up like. Ditching that old buggy implementation that wasn't really worth maintaining and as soon, like when we saw app intense at ww DC 2022. So like that was kind of like a technical motivation. Another technical motivation would be getting more comfortable with like, sorry, with like async, AWAI and main active. Yeah, I remember that in the Alaina Kafkes (guest): bad.

Yeah. 'cause you wanted to, you wanted to take the opportunity to upgrade to Async away, and that was part of what Apen Hunts was was Alaina Kafkes (guest): Yes, it was a, a good, good little trial. And then there were like the, the business reason was kind of like we had started to shift our focus more to user engagement because we realized that lots of people. Download the Calm app in like a time of crisis, but sometimes they like don't, yeah. They forget about it.

Or like they see the home screen and they're like, now what? So we have been pursuing a lot of like projects around like better engaging our users with the app, like giving them like what they want and something that they would want to come back to from like a mental health perspective. Does app intense replace Siri kit, if you know what I mean, Alaina Kafkes (guest): Yeah, so this is a great question and I'm gonna call out. I made a mistake here when I went into this project.

I did not know the answer to this question, and I found out the answer quite late in the game. So, app intents do not replace Siri kit. So app intents are basically what you should be using for for custom intents that aren't already supported by Siri Kit like. Siri kit for instance, has like, I don't know, like play media intent. I know there are others. There are like subclasses of ion intent that you should be using if they exist and if they meet your need.

But if they don't, then app intent is better. Okay. Okay, that makes total sense. So. That was interesting. Like a big, big thing you mentioned was user engagement, which is super difficult with with apps because we all think, oh, the success is getting someone a, getting your app built, getting approved from the Apple store and then getting people to download it. That's all great, but like if nobody's using it, like you kind of screwed so.

Alaina Kafkes (guest): Yeah. The, like, the user engagement, like that seems like a big selling point for, for, for you implementing this in your app. What are, what do you think are some, like, calm, we all know what CALM does but like what would be some other apps that you think would be ideal for implementing this in their application? Alaina Kafkes (guest): Ooh, that's a, that's a good.

Question before I answer it, I realized that I might not have been entirely clear on why app intent even relate to user engagement, and I just wanted to call out that like when you use the app intense framework you are able to get kind of this like auto magical, um, exposure of your app, intent to like series shortcuts and spotlight as soon as the user downloads the app. So I just wanted to make that okay.

Okay. Yeah, yeah, yeah, Alaina Kafkes (guest): but to actually answer your question of like what sorts of apps should be using app intent, um, I think the, like the generic answer would be like an, an app in which you could imagine, a, a user actually wanting or needing to invoke actions via Siri. So I don't know.

Siri is just the thing that pops into my head when I I think of shortcuts like secondarily, but I. Another, like a, something that I've read about but I'm not like a total expert in necessarily, is that Siri is often used by people with certain like neurocognitive differences. And I actually heard in a conference talk by, I believe Robin Kza, I'm not sure if I'm pronouncing her last name that like offering multiple ways to do. The same thing.

To take the same action is great from an accessibility perspective because like maybe all of these different ways are accessible to me, but like for someone, one way, one path of entry into the app is like more accessible than another, or like one way of doing an action would be more accessible than another. So that redundancy can be positive from an accessibility perspective.

The short to me, like, not the shortcuts, but the spotlight seems like a big selling point because like if I'm gonna, if I'm gonna pull up my phone and like, you know, try to search for something and it's like, Hey, by the way, here's your directions to so and so, or here's a, why don't you go to Starbucks thing? It's gonna be like a little bit more tempting for me to use the app. And like that to me is one of the bigger selling points, is that it.

From my my understanding is it uses intents to figure out when you're more likely to use the app and then suggest it in spotlight. And to me, like that's a big gain. If you're trying to get user engagement. Alaina Kafkes (guest): That's very fair.

It's like subtle but powerful because I am using Spotlight regularly, but I don't think that I'm using Spotlight regularly because like, I, I, I mean, again, I would guess that your average, like iPhone user does not necessarily know that that feature's even called Spotlight. They're just like, oh, it's the search thing. So it's subtle. Yeah, yeah. Totally. Exactly, exactly.

What is, what's the relationship, and correct me if I'm wrong, but is it, what's the relationship between app intents and NS user activity? Are those related in any way, or is that something totally different? Alaina Kafkes (guest): that's a good question. I think that they're different. They might be related, but I did not end up u using any of the like NSS user activity APIs for this particular project. I think that w the way.

If I'm not mistaken, but like, there is like this concept of donating intents that comes from Siri kit and it's like really odd phrasing, but what donating intense. It's like, what, what? Yeah, it took me a how generous of you. Yeah. Alaina Kafkes (guest): Yeah. And, and basically it's like that, that is like another way of telling Spotlight like, Hey, this user is like taking this particular action. Like they're playing this particular piece of content.

Within the call map at this particular time of day, and then maybe you would start to see spotlight suggestions at that time of day. Yeah, yeah, yeah. Exactly. Exactly. I wanted to ask next what were your biggest challenge was, but before we do that, I'm gonna, I'm gonna hop back and I'm gonna ask this technical question because you mentioned it in the article and you mentioned it earlier, but like a sink of weight. What was that experience like?

Migrating or implementing, using a syn away in calm. Alaina Kafkes (guest): So great question. Like, to be super clear, the majority of the calm app does not use a single weight. There are just like some places where we have been branding like, I don't know, new things and app. You're not gonna like go in and overhaul it. Yeah, it totally makes sense. Alaina Kafkes (guest): But honestly for me, the concept wasn't difficult.

And I think it was because at my previous job I had written some, I guess like backend, like JavaScript code that had Prom. Not Alaina Kafkes (guest): if that makes Yeah. Alaina Kafkes (guest): Yeah. Like based effectively promises. So for me, the learning curve had already happened in like another programming language. Yeah. Yeah. I think for me, I'm in the same boat. It was JavaScript or C that had already done async away, essentially.

So it wasn't too much of a challenge, but what was, was the whole ta how to deal with tasks, like doing multiple tasks at the same time. The the whole actor concept is still something I feel like I'm trying to wrap my head around. So that's probably more of the challenge, but yeah. Yeah, yeah. Exactly. Exactly. Yeah. Fair. Good. It was. I think we, we have same experience there. So, so besides that, what was the biggest challenge implementing app intenza?

What kind of like issues did you run into? Alaina Kafkes (guest): Yeah, that's a, that's a good question. I feel like the overarching answer is just the, so the, I think that the framework, it came out in ww DC 2022 and my, like me and like my fellow engineers started working on this, let's say like. A few months after that.

So just the newness of the framework meant that there was nothing on Stack Overflow, nothing, no answers on the developer forums, and then like the documentation, sometimes you would just see the, I don't know if it said like beta software, but it was just like, okay, every, you can't trust anything written here, Yeah. And on top of it, it's an abstract framework, right? It's not like, oh, I know exactly. This is for doing virtual reality on the vision Pro. Like you can know exactly what it is.

This is a very, like you said, it uses certain terms like donate and intent that are very, very, very abstract. So yeah, I could, I could see how the challenge is there. Alaina Kafkes (guest): That's a really good point too. But I, I will say that I think the most concrete challenge, at least for me, was string localization. And that might be because I was working within like this. I don't know, pre-existing legacy app, if you will.

And we already have like, strong like scripting and automation around like converting NSS localized strings into, or like converting them into like a file format that like a translator could read. And like make translations of and then get back to us with those translations and have that just automatically like get into like the app store builds, we submit.

So the app intense framework requires this new type called localized string resource that just doesn't like play in the same way as NS localized string. So like bridging between those, I mean I had to do some. Honestly kind of shady things that I wouldn't recommend, but like I think that's just sometimes true within like a legacy app environment. But if you're just like trying this for like a side project, you'll be fine.

Okay. Okay. What, so string localization, anything else you ran into that you were surprised by when you were implementing it? Alaina Kafkes (guest): When I was implementing app intents I noticed that whenever I was doing something, some sort of action within an app intent that would touch realm, I had to be like very careful with the threading. Like I was just wondering why things weren't working or why, why the app. I Was gonna Alaina Kafkes (guest): crashing, but that was challenging.

I like, somehow the specifics have like left my mind, which is maybe a good thing in a way, but like I remember generally that was, that was difficult. And that was not a challenge that I wrote about in the blog post that I published for Calm. So what what were some architectural challenges that you ran into with app intents? Like, is it, it's, is it an extension or is it part of the app itself?

Or, and like, how did you have to work around the, the existing infrastructure to get it to work properly? Alaina Kafkes (guest): That is a good question. So, I did not implement this as an extension. I'm pretty sure that there are two paths with app intent, either just adding the intents to your, I guess, main target or creating an extension. I think both are valid.

If I recall correctly, in the documentation, apple says that it is best to just implement them within the main target, and the extension is kind of like. It, I don't know. There was some like exception, but the calm app did not meet that exception, um, for architectural challenges. Fortunately, like these app intents are basically these like, I don't even know. They're not really touching. I. Like other parts of the Calm app.

I think that the biggest technical challenges were like working with Realm and like the threading concerns that come up there. And then the string localization that was not, it's not so much like an architecture thing, but like we have all these like scripts and automated processes and this new localized string resource type just doesn't naturally fit into them. So. Okay. Okay, that makes a lot of sense. What are, so let's, let's kind of break down. The components of app intents.

So you talked about donating. What, what do you mean? Let's, let's start off with what's an intent exactly. Alaina Kafkes (guest): Just think of it as like a piece of functionality or like an action that you can take within the app. Like for instance, on Calm, you can. Play the Daily Calm or like one of our like content types. But there also could be an app that's like, or sorry, there could also be an app intent for like a different app that's like, rate this book or whatever.

And you have this like mini UI Yeah. Does, does it take parameters or is it specifically just one specific thing that it does? Alaina Kafkes (guest): That's a good question. So it does take parameters if you so choose. Like you can have like an app intent that only does one thing, doesn't need parameters. But yes, the app intent that you create can take parameters that kind of like change what it does slightly or more like variations on a theme, if you will.

Like for instance, in the Calm app, we have, I believe four types of. Daily meditations and meditations where you get a new one every day. So I created an app intent with a parameter that's like daily meditation type that allows you to play each of those four dailies by like invoking. Basically the same command on Siri. It's like, Hey Siri, play the daily calm on calm. Hey Siri, play the daily trip on calm, et cetera. Like you can tell that there's like a little bit of a string formula there.

Yeah, yeah, yeah. Okay. That makes, so that makes total sense. So what other components are there to app intents? Alaina Kafkes (guest): Yeah. you need to do, like in an app delegate? Is there anything special you need to do with Swift ui? I guess I. Alaina Kafkes (guest): Yeah, these are good questions. So, in re Swift UI, if you were to create so calm doesn't, does calm, does not do this.

First of all, all of the Calm app intents just like start playing content, so there's no like UI needed there. But in the example that I mentioned that's like, write this book as an app intent, you could create like a little. Mini user interface using SWIFT ui. I'm the name for that escapes me. But there is like a specific way of doing this within the app intense framework. Probably something like wits, I would assume. Alaina Kafkes (guest): yeah, it's very vigi, very widget like.

Would make sense. Alaina Kafkes (guest): yeah, I think in terms of, of other, other components that I think are worth knowing about there is this concept of an app shortcut, which is. Distinct from an app intent. So like, sounds extremely confusing, but App shortcut is just like a way of making your app intent something that the shortcuts app can access. Like, I know it sounds like very silly when I, when I say it right now, but yeah. No, but it makes total sense. It makes total sense.

Is there anything you have to do with like, in like the info p list or in the app settings to get this going and get it started? Alaina Kafkes (guest): Good question. Oh yes. You mentioned the app delegate as well. No, actually unlike I believe with Siri Kit, you do have to add this to, I don't know if it was the info p list or somewhere, some sort of more like app upsetting situation.

Yeah. So you just, you, you add the app intent to your application just by implementing a specific protocol and that's it. Alaina Kafkes (guest): Yes. Wow. That's awesome. Okay. Alaina Kafkes (guest): Yeah. No, it is very nice. App intent is a protocol. Like, I didn't say that when I was trying to come up with like how to like precisely define it earlier, but yes, app intent is a protocol and you just like. Make something that conforms to that protocol that does an action within your app.

And then it just tells the OS Hey, this is, these are the things I can do. Okay. That's awesome. Did you do, so Calm is also a watch app. W was there any difficulties or how did that work? As far as the watch app and app intents? Did you have app intent for the watch and the phone, or what was the relationship there? Alaina Kafkes (guest): Great question. So I only implemented app intense on the phone, not on the watch. I actually did work on the Apple Watch app, though.

That was like a whole other project. A whole other Congratulations. Welcome to the, to the Club of watchOS to app developers. Yeah. Alaina Kafkes (guest): Yes, yes. It was a wild time, but a different story. Yeah. Was this, sorry, was this watch kit or was this swift ui? Alaina Kafkes (guest): It was Swift ui, so we had a watch kit app and I, I converted it to Swift ui and that was a, yeah, another project.

Yeah. Yeah. Cool. I was gonna ask if you know anything about multi-platform support when it comes to app intents. I don't know if you know anything about that. 'cause you did some watch stuff. Do you know? Alaina Kafkes (guest): do not, sadly, I know that Siri kit. I feel like I remember seeing a ww DC talk some years ago about Siri kit and multi-platform intents. But I don't know if I ever saw that in the app intent like documentation or the ww DC videos I watched.

Like, but that doesn't mean that you can't do it. It just means that I don't know how, haven't been exposed to how, yeah. yeah. Fair enough. Was there anything else you wanted to mention about app intents or the work you're doing at Calm right now Alaina Kafkes (guest): That is a, that's a good question. I will say that even though there were like a lot of struggles that I encountered while working on this app intense project, we actually did see some like uptick in user engagement.

So you could say that it was worth it. Yeah, that sounds like it. Totally. Would you, if you were gonna build an indie app, what would be your decision process? A, would you just say, yeah, definitely doing app intense, or would there be some like decision process where like, eh, I don't know if this is really worthwhile. I. Alaina Kafkes (guest): no. Great. Great question.

I feel like to me, app tense aren't necessary unless you can imagine like a strong use case for your app via something like Siri. Or like to your point about spotlight and like those suggestions being meaningful, if you feel like that would be meaningful, then you should go for it. I think that the accessibility case that I made earlier can also be compelling. It just very much depends on the context of like your app and your, your user base or your, you're hoped for user base.

Okay. Fair enough. Elena, thank you so much for coming on. This was awesome. Where can people find you online? Alaina Kafkes (guest): Yeah, great question. I can be found on Twitter at Elena Kafkas. I will say that I'm currently locked out of my Twitter account. Don't know why, so I gotta resolve that. But if you, if you, if that is an issue and you still need to contact me, you can find me on LinkedIn if you would like. Awesome. Elena, thank you so much for coming on. I really appreciate it.

Alaina Kafkes (guest): Yay. Thank you, Leo. It's been, it's been cool, like the good refresher on the work that I did and like, oh, like I feel like talking about things and talking about things again, always increases my own understanding of them too. So useful for me as well. Yeah. People can find me online on Twitter or X or whatever it's called at Leo Dion. My company is Bright Digit. I'm on Mastodon as well at Leo Dion at C dot. Im consider supporting the podcast and the YouTube channel.

We have our Patreon account, so definitely check that out. patreon.com/bright digit. And if you saw this on YouTube, please go ahead and like, and subscribe or. Give us a review. If there's something you want to talk about, are you gonna be speaking at a conference or anything, just reach out to me. I'd love to have you on the podcast. Thank you so much and I look forward to talking to you again. Bye everybody.

Transcript source: Provided by creator in RSS feed: download file