Improving Handoff with iCloud

Martin Jr Powlette
4 min readMar 11, 2018

--

Handoff is a really cool feature on most Apple devices that allows you to start an activity on one device and continue it on another. It’s zero-configuration and pretty seamless when it does work. It does, however, have its shortcomings;

  • It’s kind of difficult to continue an activity on iOS, particularly when the device is locked.
  • It requires the source device to be awake and that the handing-off app be in the foreground.

On iOS you have to unlock your device, invoke the multitasking UI, then tap on the Handoff prompt. It’s a bit better on the iPad with iOS 11 because it’s in the dock, just like on macOS.

Also, I find that most times I want to continue an activity, that I’ve already locked the device I began the task on. Consider this scenario; You’re reading an article on your MacBook before heading to work. Your bus is arriving soon so you close your laptop and head out. You want to continue that task once settled on the bus but unfortunately, you can’t use Handoff because your laptop is shut in your bag.

From the Handoff Programming Guide

Handoff currently works with an object called NSUserActivity. When a user begins a certain task, such as opening a new webpage, a user activity object is created. It contains information needed to Handoff that activity to another device, such as the URL and scroll position. This information is updated as you work through your task. The system lets your other devices know that a Handoff eligible activity is available. Once a user chooses to continue an activity, the system sends over the information saved to the receiving device. Optionally, you can open a stream between the two devices to send larger amounts of data depending on the task.

My proposal is to store this activity object in iCloud.

With iCloud, the implementation would look something like this;

  1. User begins activity.
  2. The NSUserActivity is saved. On save, the activity information is pushed to the user’s private iCloud database. A save is also triggered once the app being used transitions into the background. This ensures that the state is available even if the device is locked or otherwise unavailable.
  3. The save to iCloud sends a silent push notification to any other devices signed into the same iCloud account. This notification lets other devices know that an activity is available to be continued.
  4. The user taps on the prompt to continue the activity. The activity information could be carried with the notification so that the activity can be continued immediately.
  5. The receiving device lets iCloud know that it continued the activity.
  6. iCloud sends a silent push notification to the originating device to let it know that the device was continued (if it’s online of course).

iCloud is a great fit here because it requires zero setup if the user is signed in. In addition, this entire mechanism can work alongside the current implementation of Handoff. This is great for offline uses, speed and reliability. The system would determine what’s best in either situation. Finally, if implemented at a system label, developers might not have to do anything past the traditional Handoff implementation to support this. The system could potentially handle this with the existing Handoff APIs

The biggest issue to address with this concept is sending larger, streamed data. One option is to have that data pushed to iCloud in the background while a user works.

For issue number one (the visibility of the feature), I think the Handoff UI on iPhone can probably be added right on the lock screen, styled as a notification, albeit with a tweaked design. I got the idea for this with iOS 11’s new lockscreen player design. It’s discoverable, one tap away and relevant.

As an added bonus, if Apple wanted to dive back into intelligent app suggestions, having a record of recent apps you used and their state would be a major asset.

Introducing PlayOff

I wanted to push this concept a bit further and implement this for music playback. PlayOff is a macOS and iOS app that implements many of these ideas with tweaks for its specific use case. It’s been extremely fun to build and I can’t wait to share it with the world!

In the meantime, I’m opening up a public beta for PlayOff before it’s released. If you’re interested and use iTunes and/or the iOS Music app, you can sign up here. I’ll also write another blog post talking about how exactly it’s built and the challenges I encountered.

Like I said earlier, I love Handoff and the idea of seamless device interaction. I want to see Handoff improve and for more developers implement it in their websites and apps (I’m looking at you YouTube). I also want to look into creating a library, written in Swift, to support this feature for other developers.

Also, this is my first blog post! It was really fun to write (and design/build the concept) and I really hope you enjoyed reading it! I’d be great to hear any feedback on the post and the concept.

Thanks for stopping by! 😄

--

--

Martin Jr Powlette

A child and storyteller at heart who designs screens and experiences, develops software and occasionally makes films.