Handoff between iPhone and iPad

NOVASOLUTIONS.TECHNOLOGY is engaged in the development, support and maintenance of iOS, Android, PWA mobile applications. We have extensive experience and expertise in publishing mobile applications in popular markets like Google Play, App Store, Amazon, AppGallery and others.
Development and support of all types of mobile applications:
Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1 servicesAll 1735 services
Handoff between iPhone and iPad
Medium
~3-5 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    756
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    624
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1052
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    947
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    862
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    445

Implementing Handoff Between iPhone and iPad

Handoff lets user continue work in app from one Apple device to another. Opened article on iPhone — app icon appears on iPad in Dock, tap — iPad opens same screen at same scroll position. Implemented via NSUserActivity and requires proper setup on multiple levels.

Prerequisites

Both devices must be logged in with same Apple ID, Bluetooth and Wi-Fi enabled. At project level — enable Handoff in Capabilities (automatically adds com.apple.developer.associated-domains and needed entitlements).

In Info.plist specify NSUserActivityTypes — array of activity type strings. Naming convention: com.bundleid.activityname. Activity not listed in this array won't be accepted by system.

Creating and Updating Activity

class ArticleViewController: UIViewController {
  var article: Article

  override func viewDidLoad() {
    super.viewDidLoad()
    setupUserActivity()
  }

  private func setupUserActivity() {
    let activity = NSUserActivity(activityType: "com.myapp.reading-article")
    activity.title = article.title
    activity.userInfo = [
      "articleId": article.id,
      "scrollPosition": 0.0
    ]
    activity.isEligibleForHandoff = true
    // isEligibleForSearch and isEligibleForPrediction — for Spotlight and Siri Suggestions
    self.userActivity = activity
    activity.becomeCurrent()
  }

  // Update state on scroll
  func scrollViewDidScroll(_ scrollView: UIScrollView) {
    userActivity?.userInfo?["scrollPosition"] = scrollView.contentOffset.y
    userActivity?.needsSave = true  // triggers updateUserActivityState before transfer
  }

  override func updateUserActivityState(_ activity: NSUserActivity) {
    activity.addUserInfoEntries(from: [
      "scrollPosition": scrollView.contentOffset.y
    ])
  }
}

needsSave = true — key moment. System doesn't call updateUserActivityState constantly — only when needsSave set. Means if forgotten, receiving device gets stale data.

Handling on Receiving Device

In AppDelegate or SceneDelegate:

func application(_ application: UIApplication,
                 continue userActivity: NSUserActivity,
                 restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
  guard userActivity.activityType == "com.myapp.reading-article",
        let articleId = userActivity.userInfo?["articleId"] as? String else {
    return false
  }

  let scrollPosition = userActivity.userInfo?["scrollPosition"] as? CGFloat ?? 0

  // Navigate to needed screen and restore position
  navigator.openArticle(id: articleId, scrollPosition: scrollPosition)
  return true
}

For SwiftUI via .onContinueUserActivity:

WindowGroup {
  ContentView()
    .onContinueUserActivity("com.myapp.reading-article") { activity in
      guard let articleId = activity.userInfo?["articleId"] as? String else { return }
      appState.openArticle(id: articleId)
    }
}

Typical Mistakes

userInfo in NSUserActivity must contain only property list–compatible types: String, Int, Double, Bool, Data, Date, Array, Dictionary. Trying to put custom object — silent failure, activity doesn't transfer without log errors.

Calling resignCurrent() on screen exit mandatory — otherwise old activity continues advertising itself on other devices until system timeout.

Timeline

3–5 days including testing on two physical devices. Simulator doesn't support Handoff. Cost calculated individually.