Chapter 8. Data Sharing

At times, you will want to share data with another app or get access to shared data from another app installed on the device. For example, a few use cases for sharing data include the following:

  • Integrating with other apps (e.g., giving users the ability to sign into your app using their Facebook login)

  • Releasing a suite of complementary apps such as those offered by Google (i.e., Gmail, Google Calendar, Google Hangouts, and Google+)

  • Moving user data from a unified app to multiple special-purpose apps, detecting their presence and transferring controls when required (e.g., the Facebook app splits into Messenger, Pages, and Groups apps for messaging, pages management, and groups management, respectively)

  • Opening a document in the best available viewer (e.g., opening a PDF file for viewing in a native viewer or a photo for editing in Photoshop Express)

Each technique for sharing data has specific constraints on what can be shared. As an example, using the clipboard may consume a lot of RAM, whereas document sharing uses device storage (both RAM and device storage must be cleared after use). Similarly, using deep linking has overheads of data serialization and parsing.

In this chapter, we discuss various data sharing options from a performance perspective and identify best practices when working with a specific option.

Deep Linking

In the context of the mobile apps, deep linking consists of using a uniform resource identifier (URI) that links to ...

Get High Performance iOS Apps now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.