00:00:06 ◼ ► And I'm David Smith. Under the Radar is never longer than 30 minutes, so let's get started.
00:00:45 ◼ ► your sleeping patterns and the duration of your sleep by wearing an Apple Watch all night.
00:01:17 ◼ ► Or if you just have an old watch that, if you've upgraded to one of the more recent ones,
00:02:06 ◼ ► and I take those three data points and then I can use those to infer information about your sleep.
00:02:39 ◼ ► And then conversely, it's like, "This seems to be the period where you woke up on the other end."
00:02:46 ◼ ► Based on my testing, I've been able to get it so that it's usually right to within maybe 10 minutes on either end,
00:02:56 ◼ ► certainly for the gain of convenience of it just magically happening with you doing nothing.
00:03:18 ◼ ► but you might hit "I'm going to sleep now" and then unexpectedly not really fall asleep for a while.
00:03:25 ◼ ► In fact, this might be more precise, because this is measuring what your heart rate and movements and everything
00:03:30 ◼ ► are actually doing as opposed to relying on the fragile, forgetful human to tell it what it's doing.
00:03:38 ◼ ► The only advantage of the old version is that, and the reason why I initially made it so that you had to say "start" and "stop"
00:03:49 ◼ ► It's certainly in watchOS 2, I think it was, or 2 or 3 when I first was able to do this.
00:04:04 ◼ ► So you would tell core motion, "Hey, I want you to record the user's motion for the next so many hours."
00:04:09 ◼ ► And the max you could do was 12 hours, which meant that I had to renew their request for data, essentially every night,
00:04:43 ◼ ► and the health data is the second-order effect of that, whereas before I was able to just analyze the raw data.
00:04:56 ◼ ► that in some ways it's slightly immaterial as to which one's more precise or which one's better,
00:05:01 ◼ ► because even for myself, as someone who has manually tracked every night of my sleep for the most part for the last three years,
00:05:10 ◼ ► it's night and day now. It just happens, and every morning I wake up, I unlock my phone,
00:05:16 ◼ ► and the first time you unlock your phone, when it unlocks the health database, it does the analysis in the background,
00:05:21 ◼ ► and then it pops up a sleep summary. So it's a totally better way to do it, and it's just one of these,
00:05:26 ◼ ► "Yep, this is the right way to do it. In some ways I probably should have been doing this for a long time,
00:05:35 ◼ ► So I have only one question. In your screenshot, in your blog post, you claim to have gone to bed at 8.37 pm.
00:05:44 ◼ ► Now, I know you're a very disciplined person, way more than me, but do you actually go to bed at 8.30 pm?
00:05:54 ◼ ► I think it speaks more to how early I wake up than to anything else. I typically wake up at about 5 o'clock in the morning,
00:06:02 ◼ ► and so I am often tired at that point, and so it works out that way to just sort of be able to...
00:06:10 ◼ ► I think I usually go to bed after 9, between 9 and 9.30, but there are definitely days where I'm just like,
00:06:20 ◼ ► If I look at my testing data, which is kind of funny that I have, exactly when I went to bed every night for years now,
00:06:27 ◼ ► there are definitely some 7.45, 8 o'clock in there too, so I'm just kind of like an old man, I guess.
00:06:34 ◼ ► Do you think when you actually become an old man, you're going to go to bed maybe before noon, even?
00:06:53 ◼ ► My day just shifts completely. I'm just shifting into a different time zone. I'm gradually going out over the Atlantic.
00:07:05 ◼ ► Alright, so I think one of my big questions about this, and we talked a little bit about this in the past,
00:07:11 ◼ ► is like, this is basically completely changing the app, and I know there were other apps in the store that were competitive with yours
00:07:17 ◼ ► that had an automated approach. Is that one of the main drivers here, or was it just like you figured out how to do it?
00:07:24 ◼ ► So, the awkward thing with this feature is that... So, Sleep++, when I first launched, was a...
00:07:32 ◼ ► And this is probably the more instructive part of the story, is like, it was, I think, the first Apple Watch Sleep Tracker.
00:07:38 ◼ ► Like, when it first came out, in my sort of classic way, where I saw this new API for Core Motion,
00:07:48 ◼ ► Like, there was a bunch of iPhone-based sleep trackers, where the ones where you put it under your pillow,
00:07:52 ◼ ► or there's some that you, like, it listens with the microphone, to hear your breathing patterns.
00:07:58 ◼ ► There's all kinds of... There's that kind of thing, but specifically Apple Watch focused. It was one of the early ones.
00:08:04 ◼ ► And the thing that I always had in the back of my mind, though, is when I was working on this feature,
00:08:08 ◼ ► is that it seems inevitable that Apple is going to add this to the Apple Watch themselves.
00:08:14 ◼ ► And so I always had in the back of my mind, as I've been working on Sleep++, that it's like I'm kind of working to this deadline,
00:08:26 ◼ ► I mean, certainly there's a market for apps, you know, certainly Overcast is an example of this,
00:08:30 ◼ ► where there can be a free first-party version of something, and third-party apps can still do well.
00:08:36 ◼ ► But I think in this case, it's always in the back of my mind had been this thing that's been kind of this existential threat.
00:08:44 ◼ ► And so I kept sort of putting off and working on other apps, working on other projects, making Sleep++ better.
00:08:52 ◼ ► And certainly once there are other apps that took the automatic approach, they're certainly one of these things that's like,
00:08:58 ◼ ► "Well, clearly this is possible." Like, I kind of always guessed that it was possible, but that certainly confirmed the fact and established that.
00:09:09 ◼ ► It still has been able to sustain a reasonable amount of interest, but it's less appealing of an app.
00:09:16 ◼ ► And I just at a certain point was like, "Well, either I need to just accept the fact that one day, maybe this June, who knows,
00:09:24 ◼ ► Apple is going to introduce sleep tracking to the Apple Watch, and maybe at that point, my app will be less appealing or less useful."
00:09:34 ◼ ► Maybe that's the case, maybe not. Maybe when they do that, maybe it'll just change how Sleep++ is useful.
00:09:41 ◼ ► Maybe Apple just stores that sleep data into the health database, so Sleep++ could become a viewer for that.
00:09:49 ◼ ► I have lots of things along those lines, but at a certain point, the app just wasn't competitive, and it wasn't interesting or compelling.
00:09:55 ◼ ► And so I just decided that one way or the other, if either I need to kill this app because I'm not really working on it,
00:10:01 ◼ ► or I need to make it as good as it can be. And in this case, I decided to take the "Well, let's just spend a couple of months,
00:10:11 ◼ ► And if this fall, this all kind of falls apart, well, at least I've got between now and September for the app to do well,
00:10:26 ◼ ► So the app is free, there's a little ad, a banner ad on the main screen, and then there's an optional in-app purchase to remove ads and support development.
00:10:33 ◼ ► So it's the same model that I use in Podometer++ and a bunch of my other apps, where it's free up front with some kind of optional in-app purchase and a little bit of ads.
00:10:44 ◼ ► See, one thing I love about this app, and it's not to 100% an effect because of the nature of not most people wear Apple watches all night to track their sleep before they're using an app like this,
00:10:55 ◼ ► but I love that because this is reading from the health database, if for some reason you have been using an Apple watch to track your sleep every night,
00:11:04 ◼ ► this automatically pulls in the latest 30 days of data as soon as you launch it for the very first time.
00:11:10 ◼ ► So many apps that are this kind of personal measurement kind of thing, you start from nothing.
00:11:17 ◼ ► You start with no data, and so you launch the app and there's a very slow build over a very long amount of time before it starts giving you useful insights.
00:11:26 ◼ ► But you can read 30 days worth of data, I assume it's just a health kit feature, right?
00:11:31 ◼ ► Sure, I mean I could go all the way back to forever. I went to 30 days just because I find that so much more practical limit.
00:11:37 ◼ ► But yeah, it is very cool that you launch the app and then there's the last month's worth of data. A) If you've been using a competitor's app, which means you were wearing your Apple watch overnight anyway,
00:11:49 ◼ ► or you just happen to be, a lot of people I know use an Apple watch for the silent alarm so they can wake up at a particular time without waking someone else in bed with them.
00:11:59 ◼ ► And so if you've been doing that anyway, just for the reason of having it tap you on the wrist in the morning, all this data is just sort of there waiting for you.
00:12:07 ◼ ► Oh yeah, because you don't have to have started a sleep workout or whatever. You don't have to have told the watch why you're wearing it at night.
00:12:17 ◼ ► Exactly. That's the whole crux of this. The whole project started, the first thing I did was to sit down and be like, "What does the Apple watch always collect?"
00:12:27 ◼ ► What data types is it collecting? And really it's steps, active calories, and heart rate.
00:12:33 ◼ ► And then to some degree it has that Apple stand hour thing where it tries to work out if you stood for more than a minute in an hour, but for my purposes that wasn't actually useful.
00:12:49 ◼ ► I can always rely on those things being collected no matter what state the watch was in. As long as it was powered up and on your wrist, that data is coming in.
00:13:05 ◼ ► There's actually a slightly funny thing there where I have every now and then there was a bug in watchOS 4.1 where the Apple watch was starting to give people stand hours in the middle of the night.
00:13:19 ◼ ► I actually ran into this because of Activity++, which tracks stand hours. One of the things it does is track stand hours.
00:13:25 ◼ ► I got all these bug reports when 4.1 came out that all these people were starting their day with two stand hours. I look at their data and it's like, "Yep, nope, the data's there. It's definitely doing it."
00:13:37 ◼ ► But stand hours, it turns out, are not a great data source. The other ones, they're actually reliable and useful.
00:13:45 ◼ ► Alright, we're brought to you this week by XOJO. XOJO is a cross-platform development tool for creating native apps for the desktop, mobile, web, and even Raspberry Pi.
00:14:05 ◼ ► And then you can do what we all joke about being impossible, which is you can literally just check a checkbox and then you have a Windows version. It's that easy.
00:14:18 ◼ ► You'll be able to build apps ten times faster, which will save you tons of time and money.
00:14:26 ◼ ► It's currently used by over 300,000 developers worldwide, from students to Fortune 500 companies.
00:14:32 ◼ ► Go take a look at their site and you will see just how many companies you know use XOJO.
00:14:54 ◼ ► So I know making this app, you run into a lot of challenges with the mechanics of getting health kit access and stuff like that. Can you walk us through that?
00:15:07 ◼ ► Sure. So one of the things about, I mean, a lot of my apps at this point deal with health and fitness data.
00:15:15 ◼ ► And I think this is an interesting topic because it causes a lot of really interesting design decisions that you have to make.
00:15:28 ◼ ► because almost all of these follow the pattern now where you have to request the user's permission to access whatever it is.
00:15:41 ◼ ► And subsequently, if the user doesn't give you permission, then you have to somehow tell them to go to the settings app or somehow get them to do it.
00:15:49 ◼ ► Or in the case of the health kit app, you actually don't know if they gave you permission or not.
00:15:54 ◼ ► Because as best I can understand, they consider that to be a privacy question that if the user declines, then they're not actually going to tell you.
00:16:03 ◼ ► All that will happen is your queries will give you no data, but you don't necessarily know if they're giving you no data because there is no data or because they said you couldn't have access to the data.
00:16:12 ◼ ► But anyway, in Sleepless Plus, I've found that I've had to navigate this a lot because I think there's at least four different types of things that I request access to.
00:16:24 ◼ ► So the legacy version, the motion tracking version, requests access to access your motion data on your phone or watch.
00:16:33 ◼ ► The new version will now also ask, alternatively, you will need to ask for health kit access to read steps, active calories, and heart rate.
00:16:43 ◼ ► There's a feature in the app that lets you write sleep analysis data back into health kit.
00:16:50 ◼ ► So once I take my data and I process it, I can write back into health kit when you went to sleep, when you were awake, that kind of information.
00:16:59 ◼ ► And then also now that you can get a morning sleep notification that says, "Hey, here's what your previous night looked like," I need to request permission to send you notifications.
00:17:12 ◼ ► So one approach you could take to this, sort of like the naive approach, and you often see this, I find this in a lot of games where it just drives me crazy,
00:17:21 ◼ ► but is the first time you ever launch the app you just kind of get this barrage of notifications asking you for stuff?
00:17:29 ◼ ► Yeah, because every tutorial out there of like, "How do you get push notifications working?" they all have you just put the request thing in application to finish launching.
00:17:36 ◼ ► So literally the very first time the app launches, and immediately upon launch, you get all of those dialogues, all from people just copying and pasting from tutorials,
00:17:45 ◼ ► and not really giving it a lot more thought of like, "When should I ask for this?" or "How should I ask for this?" It's all just in "Did finish launching."
00:17:53 ◼ ► Which is awful, from a user experience perspective, because maybe it's the perspective I take, but I want my user to give me access to this stuff because they trust me.
00:18:06 ◼ ► That I've established at least some base level of competence that they're not just trying to bank on the fact that half the time people won't use it, and 50/50 they'll just push the button I want.
00:18:20 ◼ ► That's really not what I want. I want them to make a choice. I want them to think, "I'm going to give you permission to do this because you're going to give me something that is useful for me."
00:18:32 ◼ ► And so, while it's a lot easier to take that approach, to just throw up a whole bunch of privacy requests, it's not great.
00:18:42 ◼ ► It's also really tricky for a situation like this, where there's multiple ones that are possible within the app. Even worse is when one pops up, and then another one pops up, and then another one pops up.
00:18:53 ◼ ► You'll sometimes see this, where you have a request for your notifications, and then it'll do a one for your location, or that kind of thing.
00:19:01 ◼ ► I really don't like that approach. So instead, the approach that I've found to do is I've worked out ways to structure my app such that requesting permission or privacy or any of those things is always the result of the user actively making a choice.
00:19:24 ◼ ► They're always going to push a button or flip a switch in the application, and when they do that, the result of them saying, "I want this feature turned on," is to then ask for privacy or whatever the relevant permission is.
00:19:39 ◼ ► For example, when you first launch the app, there's no request for anything, but there's a message that explains how automatic sleep tracking works.
00:19:49 ◼ ► Below that, there's a little option that just says, "Would you like to enable sleep tracking?" It's a little UI switch.
00:19:56 ◼ ► As soon as you flip that switch, it'll then pump the dialog and ask for access to read your health data.
00:20:09 ◼ ► I figure there, I may as well combine those two together, because they kind of go together, but in general, you said, "I want to turn this on," and it pops up.
00:20:19 ◼ ► Similarly, if you go into the settings area and you want to turn on the morning sleep summary notification, as soon as the first time you flip that switch, it'll pop up and ask for your permission to turn on notifications.
00:20:31 ◼ ► Or if you want to use the manual mode, which requires the core motion data privacy permission, the first time on the watch, when you push the "Start Sleep" button, it'll prompt you there and say, "Would you like to give me permission to access your motion data?"
00:20:47 ◼ ► That approach of making it this two-step thing, I found works pretty well. In general, I rarely have a situation, it certainly does happen, but it's pretty rare where I get the customer support question saying, "It isn't working," and it turns out it's because they turned off permissions.
00:21:07 ◼ ► I think that's largely because, in general, they're in a mind space where they want to give the app permission, and so it works better in that way, rather than doing it in this more blind, amorphous, aggressive way, where I think people are more likely to turn it off.
00:21:22 ◼ ► Honestly, it's probably going to cause more trouble for me down the road, just because people aren't going to have it turned on, and if you don't have health permission turned on, if when that thing popped up and you didn't know what was going on and you just hit "Cancel," then the app won't work.
00:21:39 ◼ ► Yeah, but I understand, I can sort of see why. I think certain apps just do it anyway, because they want to get the notification permission, for example, for nefarious reasons.
00:21:51 ◼ ► That they want to be able to send you, "Hey, it looks like you haven't used the app in a while. Maybe you want to come back?" They want to send you those kind of notifications, and if they pop it up, it did finish launching, and for 25% of people, they just hit "OK," and that works fine.
00:22:10 ◼ ► That's a different approach, but for me, it's taken a lot of thoughtful design to make that happen and to work out ways to structure things such that there's always a user's intent that is causing the permission to happen.
00:22:28 ◼ ► And so it's a recommendation that I think I can make that even though it's a little bit more complicated and a little bit more thoughtful that you have to be in your design, I think you end up with a much higher level of user trust that I'm never asking you for something unless you ask me for it first.
00:22:43 ◼ ► And then it's also just beneficial because it ultimately reduces your support burden by people actually saying, "Yes, I do want to turn that on," because I'm not asking you for your permission. If anything, you're asking me to turn the thing on for you, so it kind of turns it around in that nice way.
00:23:00 ◼ ► And you can also do smart stuff like if you're showing a screen that's like "Enable this setting," and you tap "Enable" and it pops up the box, if they say "No," then you can also disable that switch in your app, like turn it back off.
00:23:13 ◼ ► So you can always check that status, and there's never a disconnect between "I have this turned on in the app, why is it not working?" and it's because they declined the permission, like you can keep that in sync. You can have the UI respond when they decline permission to show them that, "Okay, well now this setting can't be turned on."
00:23:30 ◼ ► And then they know, "Okay, well maybe I should turn it back on and then allow it this time."
00:23:34 ◼ ► And I think that there's so many of these patterns there where it's nice also to have this sense of gradual expansion of the capability of the app, which is also useful, which is what you're talking about, where it's like teaching the user where things are in the settings, for example.
00:23:57 ◼ ► They went and they turned it on, but it isn't too much too fast. The app doesn't do all of its features all at once. It starts off more straightforward, more sort of simplistically, and then expands out from there, I think is also a nice thing.
00:24:12 ◼ ► And so you have the advantages, like you said, of you're making it, there's this very direct thing, and if you pop it up and they say no, you can immediately update your settings area in a place that they know where to go and find the details about it.
00:24:27 ◼ ► And so that kind of works. It's a pattern that I think just works so much better, and I wish more apps would do it rather than, you know, every time I see a permission prompt, the very first time I launched the app, I always think, "This is just the worst way to do it."
00:24:40 ◼ ► And half the time it's like, "No, I don't," and then I'll just delete the app or I'll go away unless it's something that I really need to use, because it just sort of shows this fundamental lack of concern or consideration about, you know, that they're not taking that privacy request very seriously.
00:24:56 ◼ ► - Yeah, or like, you know, they just aren't necessarily very thoughtful about the user flow of their app. Like, they put it in DID Finish Launching and that's it. And like, so with Overcast, I do something kind of in the middle of that and you.
00:25:10 ◼ ► What you're doing is the best way to do it. I implemented push notifications literally like forever ago, like in version 1.0, and so I do it not in DID Finish Launching, but I do it upon login.
00:25:22 ◼ ► So Overcast requires an account, and so you log in and then it kicks you into the main interface. And after the login is when I prompt for notifications.
00:25:33 ◼ ► Now that's not ideal. The ideal time to do it would be if I had like a little like intro screen that's like, "Okay, you've logged in. Now, do you want notifications on? Yes or no?"
00:25:44 ◼ ► And then if you hit yes, then ask, you know, similar to what you're saying. Like, that would be the ideal way to do it. I have not yet built one of those like intro screens yet, but I keep like every major version, I keep having like a couple more reasons why I should probably build one of those.
00:25:58 ◼ ► And so I probably will start doing that at some point soon because I have a number of like good like customer service reasons why I should probably have one of those intro screens.
00:26:07 ◼ ► And not to like draw the arrows on the interface to show people where buttons are, but just basically like to set common global settings that not everyone agrees what they should be.
00:26:16 ◼ ► So like I think, you know, one of them would be like, "Do you want episodes to download or stream?" Like that's a big one.
00:26:21 ◼ ► And I could explain in like two sentences on that screen like, you know, "Downloading will always be available. Streaming, you'll save space on your device."
00:26:28 ◼ ► Like, you know, there's stuff like that that I could do. And then if you just logged in and you want things to stream in the current setup, it defaults to download.
00:26:37 ◼ ► And so you log in, you don't actually want to start filling up your phone, but as soon as you log in and it syncs that data, it's going to start downloading stuff.
00:26:45 ◼ ► And so it's going to start filling up your phone. And so that's what most people want, but it isn't what all people want.
00:26:50 ◼ ► So like, you know, there's reasons for me to make this, you know, kind of intro screen.
00:26:53 ◼ ► But anyway, so yeah, the way you're doing it is great because like you first explain why they would want this feature.
00:27:06 ◼ ► And like if you look around the app store, like major apps, like big, you know, big name apps that have presumably done lots of like A/B testing and metrics and everything else to see like what drives the most X.
00:27:17 ◼ ► They all do that. They all will like explain why they're about to show you a dialogue that asks you for something.
00:27:24 ◼ ► And then they show the dialogue. And usually they'll explain it in a way that's like, you know, for this to work, you're about to see a notification screen.
00:27:38 ◼ ► Because that, that works better. It's nicer for the users. It gets more people to say yes. It reduces support problems.
00:27:44 ◼ ► It's just better for everybody if you can do it. And not every app can do that easily. But a lot more of them can than currently do.
00:27:57 ◼ ► That it's like, it's an area that I think you can endure yourself to your user by being respectful of them.
00:28:04 ◼ ► And like building that level of trust is, especially for, I mean, honestly, like a lot of apps like ours where it's, in some ways the business model is based on a certain amount of goodwill.
00:28:19 ◼ ► And like this is, being respectful is a great way to develop goodwill. As well as just being the right thing to do.
00:28:25 ◼ ► Well, congratulations on the launch of Sleep++ 3.0. You can find us on the App Store, presumably by searching for Sleep++.
00:28:33 ◼ ► Or if the App Store search sucks today, go to david-smith.org and look at the blog post there and that link's right to it.
00:28:44 ◼ ► And if people want, if you can give a 15 second version of how do people sleep all night with their Apple Watch and the battery doesn't go dead?
00:28:51 ◼ ► Sure. I mean, the simple version is get a Series 3 watch and this just won't be an issue for you. They last for a very long time.
00:28:58 ◼ ► If you have an older watch, you can still do it. What you find is you just, anytime you're not wearing your watch for another reason, like taking a shower, getting red dressed, those types of situations.
00:29:08 ◼ ► Just put it immediately, put it on a charger. And I found that even with the Series 0 watch, if you charge it for, say, 30 minutes, 45 minutes in the morning, maybe 30 minutes at night when you're getting ready for bed, you'll be able to get through the day just fine.
00:29:23 ◼ ► Because the Apple Watch is pretty good at using very little battery overnight and so you're not actually incurring that big of a loss.
00:29:30 ◼ ► So that's just, once you kind of get into those habits that if you're not wearing your watch, it's on the charger, you won't have any trouble.