简体   繁体   中英

How did Buffer create the Share Menu feature for their iOS 8 app?

Buffer app for iOS 8 got a feature that lets you send an image from the new iOS 8 Share Menu to their app. The flow is like this:

  1. Open iOS Photos app
  2. Select an image and tap the share icon
  3. Select Buffer from the menu (you may need to enable it first)
  4. Buffer app opens and the image is automatically attached in the composer window

How did they manage the part to invoke their full app without using a small widget like most of the other apps do?

iOS Developer at Buffer here. So we make use of iOS 8's new extensions using a share app extension as detailed in the types here... https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ We actually do invoke just an extension rather than the full app.

We use the same composer code within the app itself and the extension by having our own Cocoapod set up which is then set up as a dependency of the app and the extension target. That way we only have 1 codebase and it shares the same familiar look and feel.

To set up a share extension you can follow along with Apple's guide here... https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionCreation.html#//apple_ref/doc/uid/TP40014214-CH5-SW1

Happy to answer any other questions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM