Instagram's Live Activity Is Not Doing What You Think It's Doing

Instagram's Live Activity Is Not Doing What You Think It's Doing
An Instagram Story upload as shown through Instagram's Live Activity. Image Credit: 9to5Mac.

So I'm yet again using my personal project to gain some dopamine and decided Live Activities would bring that golden touch I was looking for. As any young-ish person in the Western world, I use Instagram way more than I would like to admit. Since, I think, last year (or maybe 2022) I'm seeing this pretty Live Activity for Story uploads on my Lock Screen – as you probably did too if you've spent any amount of time bragging about a lunch with friends through Stories.

I always assumed that meant Stories were uploaded on the background but see, I was wrong. What fun it would be if I could just implement what I wanted through a nice and easy API from Apple and be done with it. New app version shipped, dopamine gained. Done. No, we're here for the party.

What took me some hours over the weekend to realize is that Live Activities and background tasks are two distinct things. And, more than that, why I think IG's Live Activity is fundamentally misleading all users (and unwise developers).

Here's a shortened version from Apple's HIG explaining what Live Activities are:

Live Activities provide frequent information updates that appear in glanceable locations such as the Lock Screen, on iPhone in StandBy, and the Dynamic Island. [...] For example, the Live Activity of a food delivery app might display the time remaining until your order arrives; a sports app could provide live in-game information for their Live Activity; and a workout app could show real time fitness metrics and offer interactive controls to pause or cancel the workout.

None of the activities mentioned by Apple involve any sort of background running and if they do – say your user backgrounded the app but the food is still being cooked – you can easily use push notifications to update the Live Activity with the help of a server.

[Dec 17, 2024 Update] I'm unfortunately not alone in this pain, as a fellow iOS developer let me know in the iOS Folks Slack:

Slack message saying "I've been explaining to PMs how Live Activities work and they think I'm sandbagging them because of Instagram".
Anonymized at the author's request.

What I'm trying to do

So I've been running this fun little app since 2022. It's called Medo e Delírio and it's a companion to the Medo e Delírio em Brasília podcast. (No, it's not my podcast.) I write more about it here. Medo e Delírio has a sync operation that's done on app startup. It goes through updates from the server and updates local information and/or downloads new sound files from said server.

My one and only intention with this whole ordeal is to achieve that nice animation users get when they background an app with a Live Activity. That swooping up trick that brings so much joy (example in the video below). That's it. That's the entire reason I'm doing this.

Swoooop

(Well, I also want to avoid any other user ever complaining about having to keep the app open on first startup because of syncing, but that's a story for another day.)

In order to achieve the neat UX shown in the video, did I carefully read all of Apple's documentation and think deeply like a sane person? No, I talked to ChatGPT.

I had never before implemented background tasks and had always assumed they required an app extension. Since Live Activities are essentially widgets that live in a different part of your phone's screen and widgets use extensions, I bunched them up in my head and thought: ok, cool, I'm gonna encapsulate the sync logic in a package and use that package from inside the widget. Wrong.

Background tasks are set up from within the app, usually through a call in the AppDelegate, and are meant to:

keep your app content up to date and run tasks requiring minutes to complete while your app is in the background. [Apple Developer]

On iOS, apps cannot when background tasks run and for how long. Beginning in iOS 4, Apple allowed a select group of apps, such as music and GPS apps, to continue running in the background. Then, with iOS 7, they introduced Background App Refresh, a feature that allows app information, like a news feed, to stay up to date. Like most things, Apple prefers to maintain tight control over what runs on their platform. In this case, they're mostly excused due to concerns about battery life and system performance. Want more control? You'll have to join the Droid army.

But updating byte-sized chunks of information whenever the system wants is not what I want to do. I want to offload the entire sync process to a background task and show the progress through a Live Activity, gaining that user delight all us frontend developers crave.

A Live Activity with a green background and progress complete is shown on a partial iPhone Lock Screen.
Current state of Medo e Delírio's Live Activity. No swooping yet.

The crucial detail

I strongly believe Instagram's UI is misleading. While their LA makes it seem like the upload is being handled in the background, experience tells me none of that is happening. If you read up to here you probably already suspect why.

The upload process is not being offloaded to a background task. At least not immediately, because, as I've mentioned above, that's not how iOS works.

What makes me trust my theory is that 99 out of 100 times I've backgrounded Instagram right after hitting "Post" on a story it showed "Your Story upload failed" on my Lock Screen. And that failure seems to be even more reliable when you're trying to upload a video or reposting a Reel. You can easily try it yourself: find a Reel, tap the paper plane Share icon, Share to Story, choose Your Story or Close Friends and swipe up to background the app.

After a couple of minutes you should see something like this:

A white rounded rectangle with the words "Your story hasn't finished uploading" and the option to Resume.
Credit: Techy Snoop.

To be clear, there are plenty of reasons to be unhappy with Meta's practices and business dealings, and me saying "Instagram is misleading us" is just the short version of the issue I saw (and a way to express my frustration). I think Apple could and probably should devise a more straightforward way for us to get Background Activities (how's that for a name?).

Next steps

My app's feature is not done. I'm exploring offloading the sync operation to a background task if the user backgrounds the app, otherwise run it as usual if the app is in the foreground (which I suspect is what Instagram is doing).

If you have more insight on this, please share. Have you tried implementing something similar in your apps? I’d love to hear your thoughts or tips on achieving this seamlessly!

I plan on writing more on this space. And long live blogging. This is fun.