iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 11)

Jonathan Engelsma
Jonathan EngelsmaAssociate Professor
Extending the Reach ofYour
iOS App
Lecture 11: Working with URL Schemes and
App Extensions
Jonathan R. Engelsma, Ph.D.
TOPICS
• Motivation
• URL Schemes
• App Extensions
EXTENDING OUR REACH…
• By default, our apps only have user
eyeballs when the user launches the app
and it has the foreground.
• The average user’s launch screen is
littered with a plethora of launch
icons…
• How can we create additional
opportunities for our app to garner user
eyeballs?
STANDING ON
SHOULDERS…
• Intentionally avoid reinventing
the wheel …
• … by utilizing the haystack of
functionality already on the
user’s device.
• Ride on the success of
somebody else’s more popular
app?
URL SCHEMES
• URL Schemes let our app send actionable data to other apps
via a custom URL.
• For example, if I was writing an app for my restaurant and I
take reservations via a reservation portal that had a popular
app with a custom URL scheme, I could invoke that app from
my restaurant app to make a reservations.
SUPPORTING A CUSTOM URL
SCHEME
• In my Info.plist I need to make an URLType entry:
INVOKING A CUSTOM URL
• Enter the custom URL into
mobile Safari:
INVOKING A CUSTOM URL
• From any app1
APP EXTENSION DEMO
APP EXTENSIONS IN IOS
• “an app extension lets you
extend custom functionality and
content beyond your app and
make it available to users while
they’re using other apps or the
system”
https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/
TYPES OF EXTENSIONS
• Today
• Share
• Action
• Photo Editing
• Document Provider
• Custom Keyboard
• Apple Watch
DEPLOYING EXTENSIONS
• Delivered to App Store as part of an app bundle. e.g.,
cannot be deployed stand-alone.
• The app that bundles the extension is referred to as the
container app.
• The app that invokes the extension is referred to as the
host app.
• An app can bundle more than one extension.
HOWTHEY WORK
• Every invoked instance of an extensions runs in its own
process.
• An extension cannot communicate with its container app.
• An extension cannot enable communication between its
container app and host app.
• Indirect communication is possible via openURL() or a shared
data container (e.g. NSUserDefaults)
EXTENSION LIFECYCLE
https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/
ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW2
COMMUNICATION WITH
HOST APP ONLY
https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/
ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW2
INDIRECT COM WITH
CONTAINING APP
https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/
ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW2
API LIMITATIONS
• app extensions cannot:
• accessed a sharedApplication object.
• use APIs explicitly marked unavailable
• access camera or mic
• perform long running tasks
• receive data via AirDrop
CREATING AN APP
EXTENSION
• Assuming the Xcode project for the containing app exists:
• Step 1: decide what extension point type makes sense
• Step 2: add a new target to the project, and select iOS /
Application Extension.
• Step 3: implement the extension.
In containing app Xcode project goto File -> New ->Target
APP EXTENSION DEMO
1 of 20

Recommended

Mobile Gamification by
Mobile GamificationMobile Gamification
Mobile GamificationJonathan Engelsma
701 views43 slides
2013 Michigan Beekeepers Association Annual Spring Conference by
2013 Michigan Beekeepers Association Annual Spring Conference2013 Michigan Beekeepers Association Annual Spring Conference
2013 Michigan Beekeepers Association Annual Spring ConferenceJonathan Engelsma
837 views24 slides
What Every IT Manager Should Know About Mobile Apps by
What Every IT Manager Should Know About Mobile AppsWhat Every IT Manager Should Know About Mobile Apps
What Every IT Manager Should Know About Mobile AppsJonathan Engelsma
866 views35 slides
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05) by
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 05)Jonathan Engelsma
1.3K views31 slides
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 04) by
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 04)iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 04)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 04)Jonathan Engelsma
1.1K views20 slides
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 02) by
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 02) iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 02)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 02) Jonathan Engelsma
930 views31 slides

More Related Content

More from Jonathan Engelsma

BIP Hive Scale Program Overview by
BIP Hive Scale Program OverviewBIP Hive Scale Program Overview
BIP Hive Scale Program OverviewJonathan Engelsma
677 views10 slides
Selling Honey Online by
Selling Honey OnlineSelling Honey Online
Selling Honey OnlineJonathan Engelsma
2.9K views33 slides
Selling Honey at Farmers Markets, Expos, etc. by
Selling Honey at Farmers Markets, Expos, etc. Selling Honey at Farmers Markets, Expos, etc.
Selling Honey at Farmers Markets, Expos, etc. Jonathan Engelsma
1.3K views31 slides
Harvesting and Handling Honey for Hobby and Small Sideline Beekeepers by
Harvesting and Handling Honey for Hobby and Small Sideline BeekeepersHarvesting and Handling Honey for Hobby and Small Sideline Beekeepers
Harvesting and Handling Honey for Hobby and Small Sideline BeekeepersJonathan Engelsma
1.9K views34 slides
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 7) by
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 7)iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 7)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 7)Jonathan Engelsma
988 views36 slides
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09) by
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)Jonathan Engelsma
805 views15 slides

More from Jonathan Engelsma(9)

Selling Honey at Farmers Markets, Expos, etc. by Jonathan Engelsma
Selling Honey at Farmers Markets, Expos, etc. Selling Honey at Farmers Markets, Expos, etc.
Selling Honey at Farmers Markets, Expos, etc.
Jonathan Engelsma1.3K views
Harvesting and Handling Honey for Hobby and Small Sideline Beekeepers by Jonathan Engelsma
Harvesting and Handling Honey for Hobby and Small Sideline BeekeepersHarvesting and Handling Honey for Hobby and Small Sideline Beekeepers
Harvesting and Handling Honey for Hobby and Small Sideline Beekeepers
Jonathan Engelsma1.9K views
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 7) by Jonathan Engelsma
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 7)iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 7)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 7)
Jonathan Engelsma988 views
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09) by Jonathan Engelsma
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)
Jonathan Engelsma805 views
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 06) by Jonathan Engelsma
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 06)iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 06)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 06)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03) by Jonathan Engelsma
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03) iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03)
Jonathan Engelsma1.1K views

Recently uploaded

unidad 3.pdf by
unidad 3.pdfunidad 3.pdf
unidad 3.pdfMarcosRodriguezUcedo
122 views38 slides
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptx by
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptxGopal Chakraborty Memorial Quiz 2.0 Prelims.pptx
Gopal Chakraborty Memorial Quiz 2.0 Prelims.pptxDebapriya Chakraborty
709 views81 slides
GCSE Spanish by
GCSE SpanishGCSE Spanish
GCSE SpanishWestHatch
53 views166 slides
Computer Introduction-Lecture06 by
Computer Introduction-Lecture06Computer Introduction-Lecture06
Computer Introduction-Lecture06Dr. Mazin Mohamed alkathiri
117 views12 slides
Retail Store Scavenger Hunt.pptx by
Retail Store Scavenger Hunt.pptxRetail Store Scavenger Hunt.pptx
Retail Store Scavenger Hunt.pptxjmurphy154
47 views10 slides
AUDIENCE - BANDURA.pptx by
AUDIENCE - BANDURA.pptxAUDIENCE - BANDURA.pptx
AUDIENCE - BANDURA.pptxiammrhaywood
131 views44 slides

Recently uploaded(20)

GCSE Spanish by WestHatch
GCSE SpanishGCSE Spanish
GCSE Spanish
WestHatch53 views
Retail Store Scavenger Hunt.pptx by jmurphy154
Retail Store Scavenger Hunt.pptxRetail Store Scavenger Hunt.pptx
Retail Store Scavenger Hunt.pptx
jmurphy15447 views
AUDIENCE - BANDURA.pptx by iammrhaywood
AUDIENCE - BANDURA.pptxAUDIENCE - BANDURA.pptx
AUDIENCE - BANDURA.pptx
iammrhaywood131 views
How to empty an One2many field in Odoo by Celine George
How to empty an One2many field in OdooHow to empty an One2many field in Odoo
How to empty an One2many field in Odoo
Celine George97 views
The Accursed House by Émile Gaboriau by DivyaSheta
The Accursed House  by Émile GaboriauThe Accursed House  by Émile Gaboriau
The Accursed House by Émile Gaboriau
DivyaSheta234 views
Monthly Information Session for MV Asterix (November) by Esquimalt MFRC
Monthly Information Session for MV Asterix (November)Monthly Information Session for MV Asterix (November)
Monthly Information Session for MV Asterix (November)
Esquimalt MFRC91 views
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant... by Ms. Pooja Bhandare
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Pharmaceutical Inorganic Chemistry Unit IVMiscellaneous compounds Expectorant...
Ms. Pooja Bhandare166 views
EILO EXCURSION PROGRAMME 2023 by info33492
EILO EXCURSION PROGRAMME 2023EILO EXCURSION PROGRAMME 2023
EILO EXCURSION PROGRAMME 2023
info33492124 views
A-Level Art by WestHatch
A-Level ArtA-Level Art
A-Level Art
WestHatch48 views
Narration lesson plan by TARIQ KHAN
Narration lesson planNarration lesson plan
Narration lesson plan
TARIQ KHAN64 views
GCSE Geography by WestHatch
GCSE GeographyGCSE Geography
GCSE Geography
WestHatch47 views
When Sex Gets Complicated: Porn, Affairs, & Cybersex by Marlene Maheu
When Sex Gets Complicated: Porn, Affairs, & CybersexWhen Sex Gets Complicated: Porn, Affairs, & Cybersex
When Sex Gets Complicated: Porn, Affairs, & Cybersex
Marlene Maheu99 views
Class 9 lesson plans by TARIQ KHAN
Class 9 lesson plansClass 9 lesson plans
Class 9 lesson plans
TARIQ KHAN53 views

iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 11)

  • 1. Extending the Reach ofYour iOS App Lecture 11: Working with URL Schemes and App Extensions Jonathan R. Engelsma, Ph.D.
  • 2. TOPICS • Motivation • URL Schemes • App Extensions
  • 3. EXTENDING OUR REACH… • By default, our apps only have user eyeballs when the user launches the app and it has the foreground. • The average user’s launch screen is littered with a plethora of launch icons… • How can we create additional opportunities for our app to garner user eyeballs?
  • 4. STANDING ON SHOULDERS… • Intentionally avoid reinventing the wheel … • … by utilizing the haystack of functionality already on the user’s device. • Ride on the success of somebody else’s more popular app?
  • 5. URL SCHEMES • URL Schemes let our app send actionable data to other apps via a custom URL. • For example, if I was writing an app for my restaurant and I take reservations via a reservation portal that had a popular app with a custom URL scheme, I could invoke that app from my restaurant app to make a reservations.
  • 6. SUPPORTING A CUSTOM URL SCHEME • In my Info.plist I need to make an URLType entry:
  • 7. INVOKING A CUSTOM URL • Enter the custom URL into mobile Safari:
  • 8. INVOKING A CUSTOM URL • From any app1
  • 10. APP EXTENSIONS IN IOS • “an app extension lets you extend custom functionality and content beyond your app and make it available to users while they’re using other apps or the system” https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/
  • 11. TYPES OF EXTENSIONS • Today • Share • Action • Photo Editing • Document Provider • Custom Keyboard • Apple Watch
  • 12. DEPLOYING EXTENSIONS • Delivered to App Store as part of an app bundle. e.g., cannot be deployed stand-alone. • The app that bundles the extension is referred to as the container app. • The app that invokes the extension is referred to as the host app. • An app can bundle more than one extension.
  • 13. HOWTHEY WORK • Every invoked instance of an extensions runs in its own process. • An extension cannot communicate with its container app. • An extension cannot enable communication between its container app and host app. • Indirect communication is possible via openURL() or a shared data container (e.g. NSUserDefaults)
  • 15. COMMUNICATION WITH HOST APP ONLY https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW2
  • 16. INDIRECT COM WITH CONTAINING APP https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW2
  • 17. API LIMITATIONS • app extensions cannot: • accessed a sharedApplication object. • use APIs explicitly marked unavailable • access camera or mic • perform long running tasks • receive data via AirDrop
  • 18. CREATING AN APP EXTENSION • Assuming the Xcode project for the containing app exists: • Step 1: decide what extension point type makes sense • Step 2: add a new target to the project, and select iOS / Application Extension. • Step 3: implement the extension.
  • 19. In containing app Xcode project goto File -> New ->Target