Implement iOS 17’s new AirDrop experience

One of the most “off radar” feature from this year WWDC probably is the new Share experience introduced by Apple with iOS 17.

From sharing your info with NameDrop, to starting a new SharePlay, we can now just approach the top of our phones together to share some content.

NameDrop is entirely system based, and SharePlay is documented with a few sessions videos from WWDC. As for AirDrop, turns out the system leverage already existing API to make it work!

Updated on June 20, 2023
Added the fact that iOS 17 NameDrop shipped with beta 2 only; and that initiating an AirDrop still need to open share sheet first for now.
“Share sheet less” share experience was marked as later this year by Apple

Marketing illustration for NameDrop

If your app is not supporting iOS 15; the simplest way to implement this new behavior is to use the ShareLink view.

Having only once of this view on a current screen magically makes the new AirDrop experience work with no extra work

struct MyView: View {
    var body: some View {
        ShareLink(item: URL(string: "https://padlok.app")!)
    }
}

Option B — UIResponder activityItemsConfiguration

Since iOS 13, and specifically for Mac Catalyst, Apple introduced the activityItemsConfiguration API on UIResponder.

Also used for the “Hey Siri, share this” feature, I wasn’t aware of this property’s existence until this year’s WWDC.

Now, starting with iOS 17, this API is enabling the new AirDrop feature as well.

class MyController: UIViewController {
    override func viewDidLoad() {
        super.viewDidLoad()

        let url = URL(string: "https://padlok.app")!
        let configuration = UIActivityItemsConfiguration(objects: [url as NSURL])
        self.activityItemsConfiguration = configuration
    }
}

Update your App now!

Since those API were introduced for iOS 16 and iOS 13 respectively, you can update your App right now to support this feature from today!

People will expect this new AirDrop experience to just work, and might feel deceived if it does not.

Since this feature is expected to be released “later this year”, probably in iOS 17.1, we cannot test the feature as is. But we can test that it works the way you intend to using “Hey Siri, Share this”. If it shares the correct information, you’re good to go!

Leveraging the new AirDrop experience for Padlok seemed like a no brainer because of the importance the share experience is in this App. This implementation is now live in the store; and will work out of the box as soon as the feature ships from Apple.

Padlok app icon

Padlok

Still looking for the codes?

Learn more

Don’t miss a thing!

Don't miss any of my indie dev stories, app updates, or upcoming creations!
Stay in the loop and be the first to experience my apps, betas and stories of my indie journey.

Thank you for registering!
You’ll retrieve all of my latest news!

Anti-bot did not work correctly.
Can you try again?

Your email is sadly invalid.
Can you try again?

An error occurred while registering.
Please try again