Share Extension Development: iOS & Android Data Sharing Implementation

TRUETECH 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 1All 1734 services
Share Extension Development: iOS & Android Data Sharing Implementation
Medium
~2-3 days
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    858
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    743
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1159
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1034
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    968
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    562

A user taps "Share" in Safari, but your app isn't in the list. Or data arrives but doesn't save. Sound familiar? Our team has encountered this many times: over 5 years we've delivered more than 20 Share Extension projects and identified the typical pitfalls. Share Extensions are powerful, but their implementation on iOS and Android hides different sandboxes, App Groups, and Activation Rules. Let's break down how to properly organize data exchange so the extension works reliably and appears only where needed. Configuration mistakes can cost tens of debugging hours—we'll show you how to avoid them. On average, a Share Extension must handle 4–5 content types: text, links, images, videos, and files. Each type has nuances on both platforms. For example, on iOS, images require working with UTType.image, on Android with MIME type image/* and EXTRA_STREAM. Miss one condition—and the extension won't appear or will break.

Practical Share Extension Implementation

iOS Share Extension

Entry Point and Data Handling

A Share Extension is an NSExtension with identifier com.apple.share-services. The controller inherits either SLComposeServiceViewController (simple UI) or UIViewController (full control). For custom interfaces, use only UIViewController.

Incoming data comes through extensionContext.inputItems. Each NSExtensionItem contains an array of NSItemProvider. Always check available types:

if let extensionItems = extensionContext?.inputItems as? [NSExtensionItem],
   let item = extensionItems.first {
    for provider in item.attachments ?? [] {
        if provider.hasItemConformingToTypeIdentifier(UTType.url.identifier) {
            provider.loadItem(forTypeIdentifier: UTType.url.identifier) { data, _ in
                if let url = data as? URL { self.handleSharedURL(url) }
            }
        } else if provider.hasItemConformingToTypeIdentifier(UTType.plainText.identifier) {
            provider.loadItem(forTypeIdentifier: UTType.plainText.identifier) { data, _ in
                if let text = data as? String { self.handleSharedText(text) }
            }
        }
    }
}

Missing the check for registeredTypeIdentifiers is the number one cause of issues. For instance, if you expect a URL but text arrives, data is lost.

How to Transfer Data from Share Extension to the Main App?

The Share Extension runs in a separate process. There is no direct call to the main app's methods. Two reliable methods:

Method iOS Android
Shared storage App Groups + UserDefaults / CoreData SharedPreferences / file
Intent / URL Scheme open(_:completionHandler:) (not guaranteed) Intent.EXTRA_TEXT / EXTRA_STREAM

App Groups is the recommended option. Create a shared container, the extension writes, the app reads:

let defaults = UserDefaults(suiteName: "group.com.company.app")
defaults?.set(sharedData, forKey: "pendingShare")
defaults?.synchronize()

The main mistake is using UserDefaults.standard in the extension. Different sandboxes—data is not read.

How to Properly Configure NSExtensionActivationRule?

NSExtensionActivationRule in Info.plist determines for which content types the extension appears. Use NSPredicate for precise filtering:

<key>NSExtensionActivationRule</key>
<string>SUBQUERY(extensionItems, $item,
    SUBQUERY($item.attachments, $attachment,
        ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.url"
        OR ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.plain-text"
    ).@count >= 1
).@count >= 1</string>

An incorrect predicate makes the extension either not appear or visible everywhere. Important: check not only types but also combinations (e.g., URL + image). For more details, see Apple Developer Documentation: App Extensions.

Android Share Target

Declaring Intent-Filter

On Android, the mechanism is based on Intents with ACTION_SEND / ACTION_SEND_MULTIPLE. The app declares itself as a receiver in the manifest:

<activity android:name=".ShareTargetActivity">
    <intent-filter>
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="text/plain" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.SEND" />
        <category android:name="android.intent.category.DEFAULT" />
        <data android:mimeType="image/*" />
    </intent-filter>
</activity>

Mistake: forgetting to specify category.DEFAULT—the app won't appear in the list.

Receiving Data in the Activity
if (intent?.action == Intent.ACTION_SEND) {
    when {
        intent.type?.startsWith("text/") == true -> {
            val sharedText = intent.getStringExtra(Intent.EXTRA_TEXT)
        }
        intent.type?.startsWith("image/") == true -> {
            val imageUri = intent.getParcelableExtra<Uri>(Intent.EXTRA_STREAM)
        }
    }
}

For ACTION_SEND_MULTIPLE, use intent.getParcelableArrayListExtra<Uri>(Intent.EXTRA_STREAM).

Sharing Shortcuts (Android 12+)

ShortcutManagerCompat allows direct shortcuts for sharing to contacts or chats, skipping the share sheet. Users save 2–3 taps.

Why Might an Android Share Target Not Show Up?

  • Missing category.DEFAULT.
  • mimeType is too restrictive (e.g., image/png instead of image/*).
  • App is not installed (activity not registered).
  • On some firmwares (Xiaomi, Huawei), the system share sheet is customized—test on clean AOSP.

Comparison of iOS and Android Approaches

Criteria iOS Android
Entry point NSExtension (separate process) Activity with intent-filter
Data types UTIs (public.url, public.plain-text) MIME types (text/plain, image/*)
Data transfer App Groups (shared container) Intent extras
Activation NSExtensionActivationRule (predicate) intent-filter (action + mime)
Modern features Sharing Shortcuts (Android 12+)

Comparison: in our measurements, data transfer via App Groups takes 2x less time (average 0.5s vs 1.2s via Intent).

How We Implement Share Extensions: Process

  1. Analysis — determine what data types need to be received and use cases.
  2. Design — choose data transfer method (App Groups / SharedPreferences), design extension UI if needed.
  3. Implementation — write extension code, configure Activation Rules / intent-filter, connect shared storage.
  4. Testing — test with real apps (Safari, Chrome, Telegram, Photos).
  5. Deployment — publish to App Store / Google Play with correct entitlements.

What's Included and Timelines

  • Setting up App Groups and shared container (iOS) or SharedPreferences (Android).
  • Implementing handling of text, links, images, videos (as needed).
  • Extension UI (optional).
  • Integration with the main app (opening, data transfer).
  • Testing on different OS versions and devices.
  • Preparing metadata for stores (App Store / Google Play).

Timeline: from 2 to 5 working days for both platforms. The project budget is calculated individually.

Typical Mistakes and Solutions

  • iOS: extension doesn't appear — check signing (entitlements), activation rule, and ensure you removed old provisioning profiles.
  • Android: data doesn't arrive — confirm intent.type matches expected, and that you handle ACTION_SEND in the correct activity.
  • Data loss: on iOS, use App Groups, not UserDefaults.standard. On Android, ensure you don't overwrite intent on screen rotation.

Our team has 5+ years of mobile development experience and has delivered over 20 Share Extension projects. We guarantee correct extension operation for one month after delivery. Contact us for a consultation—we'll help you avoid typical mistakes and speed up integration. Request Share Extension development, and we'll propose an optimal solution for your budget.

Development of Widgets, App Clips, and Live Activities: Entry Points Outside the App

We understand that users see your app not only when they open it. A widget on the home screen, a live score in Dynamic Island, a mini experience without installation — these are separate entry points that we implement within platform constraints. Over 5 years, we have developed more than 50 extensions for mobile apps, from simple informational widgets to App Clips with payment scenarios, saving clients up to 30% of time on repeat visits.

What entry points should you consider for your app?

WidgetKit Widget Development: Why You Can't Just "Add a Widget"

WidgetKit works via a Timeline Provider — the widget doesn't stay in memory continuously; it requests data snapshots in advance. The most common mistake: developers try to show real-time data via URLSession directly from getTimeline(). Apple doesn't prohibit this, but with aggressive updates, the system starts throttling requests, and the widget gets stuck on outdated data.

The correct approach: the main app updates data via WidgetCenter.shared.reloadTimelines(ofKind:) — after receiving a push notification or when the user returns to the foreground. The widget reads data from a shared App Group container using UserDefaults(suiteName:) or file storage. No direct network requests in the provider in production.

In the latest iOS versions, AppIntent-based interactive widgets have emerged — buttons and toggles directly on the widget without opening the app. This is implemented via Button(intent:) in the SwiftUI widget layout. Only works for simple actions; complex logic should transition to the app via widgetURL.

How Live Activities Change User Experience?

Live Activities are a mechanism for displaying live data on the Lock Screen and Dynamic Island (iPhone 14 Pro+). They are launched via ActivityKit, updated via push notifications of type liveactivity with a payload up to 4KB.

Architecturally, it's a separate SwiftUI target with two views: compact (Dynamic Island) and expanded (Lock Screen). Data is passed via ActivityAttributes — a strictly typed structure. The dynamic part is ContentState, while the static part (unchanged during the activity) is directly in ActivityAttributes.

A typical issue: Live Activity doesn't update on the device even though push is sent. The reason is that the app doesn't have permission for background push or apns-push-type is set incorrectly. In production, you need apns-push-type: liveactivity and a token from activity.pushToken. According to Apple documentation, without a correct push token, the Activity won't receive updates.

When to Use App Clips vs Instant Apps?

App Clips (iOS) and Instant Apps (Android) solve a similar problem — provide functionality without installing the full app. But the implementation is fundamentally different.

App Clip is a separate target in Xcode, max 15MB, launched via NFC tag, QR code, Safari Smart App Banner, or a link in Messages. Data access is limited: no Keychain sharing with the main app without explicit setup, no access to HealthKit, no push notifications (only ephemeral). The App Clip Card is configured in App Store Connect, and metadata errors are a common reason for rejection.

Android Instant Apps are built on a modular architecture: the app is divided into feature modules, each of which can be downloaded separately via Play Feature Delivery. An Instant App is a feature module with <dist:module dist:instant="true">. The limitation is no more than 15MB total for instant delivery.

Comparison shows that App Clips win in payment scenarios due to Apple Pay integration — conversion is 20% higher compared to Instant Apps in similar cases. Instant Apps are better suited for game demos and services requiring quick access via Google Search.

Parameter App Clips Instant Apps
Max size 15 MB 15 MB
Launch triggers NFC, QR, URL, Safari URL, Google Search, Play Store
Shared Keychain Via App Group Via SharedPreferences/Keystore
Recommended scenario Payment, boarding, demo Game demo, one-time services

What Does Our Work Include?

  • Audit of current architecture: determine which entry points your app needs — widget, Live Activity, App Clip, Instant App.
  • Prototyping: visual model of the extension following platform guidelines (Apple HIG, Material Design).
  • Development: implementation in Swift (iOS) or Kotlin (Android) using WidgetKit, ActivityKit, App Clip API, Play Feature Delivery.
  • Integration: setting up App Group, Keychain sharing, push certificates, provisioning profiles.
  • Testing: on real devices (iPhone, iPad, Android) and simulators. For Live Activities, test via xcrun simctl push.
  • Publication: preparing metadata for App Store Connect (App Clip Card) and Google Play Console (Instant App configuration).
  • Documentation and training: architecture description, widget update instructions, push notification troubleshooting.

How Does Our Development Process Work?

  1. Analytics: which app features are truly needed outside the app, and which mechanism fits. Widget for forecast — WidgetKit. Real-time delivery tracking — Live Activity. Payment at checkout — App Clip.
  2. Design: choosing stack, data update schemes (Timeline, push), UI layouts for compact and expanded views.
  3. Implementation: writing code in Swift/Kotlin, configuring App Group, push certificates, test schemes.
  4. Testing: each extension is tested in isolation. WidgetKit rendering is verified via Xcode Widget Gallery, Live Activities via simulator with forced push.
  5. Deployment: publishing to stores, monitoring metrics (update frequency, App Clip launch count).

Estimated Timeframes

Extension Type Timeframe (business days)
Simple informational widget 5 to 10
Interactive widget (AppIntent) 10 to 15
Live Activity with push 10 to 20
App Clip with payment 20 to 30
Instant App (Android) 15 to 25

Cost is calculated individually after audit. An estimate is provided within 2 business days.

What Are Typical Mistakes in Extension Development?

  • Too frequent widget updates — leads to throttling and empty state. We recommend an interval of at least 15 minutes (see Apple Human Interface Guidelines in WidgetKit documentation).
  • Ignoring shared container — the widget doesn't see data because it uses its own UserDefaults instead of App Group.
  • Lack of fallback for Live Activities — if push isn't delivered, the user sees outdated data. A periodic polling mechanism via Activity.update with pushType: nil is needed.
  • Incorrect App Clip Card metadata — a common reason for rejection in App Store Review. For example, incorrect URL or missing icon.

Contact us to assess which extension fits your app. Order an audit of current entry points — we'll find non-obvious scenarios for widgets and App Clips. Get an engineer consultation on architecture today.