SlideShare uma empresa Scribd logo
1 de 20
Baixar para ler offline
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

Mais conteúdo relacionado

Mais de Jonathan Engelsma

BIP Hive Scale Program Overview
BIP Hive Scale Program OverviewBIP Hive Scale Program Overview
BIP Hive Scale Program OverviewJonathan Engelsma
 
Selling Honey at Farmers Markets, Expos, etc.
Selling Honey at Farmers Markets, Expos, etc. Selling Honey at Farmers Markets, Expos, etc.
Selling Honey at Farmers Markets, Expos, etc. Jonathan Engelsma
 
Harvesting and Handling Honey for Hobby and Small Sideline Beekeepers
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
 
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)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 7)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)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 09)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 06)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)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03) Jonathan Engelsma
 
So You Want To Be a Beekeeper?
So You Want To Be a Beekeeper? So You Want To Be a Beekeeper?
So You Want To Be a Beekeeper? Jonathan Engelsma
 

Mais de Jonathan Engelsma (9)

BIP Hive Scale Program Overview
BIP Hive Scale Program OverviewBIP Hive Scale Program Overview
BIP Hive Scale Program Overview
 
Selling Honey Online
Selling Honey OnlineSelling Honey Online
Selling Honey Online
 
Selling Honey at Farmers Markets, Expos, etc.
Selling Honey at Farmers Markets, Expos, etc. Selling Honey at Farmers Markets, Expos, etc.
Selling Honey at Farmers Markets, Expos, etc.
 
Harvesting and Handling Honey for Hobby and Small Sideline Beekeepers
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
 
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)
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 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)
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 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 06)
 
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)
iOS Bootcamp: learning to create awesome apps on iOS using Swift (Lecture 03)
 
So You Want To Be a Beekeeper?
So You Want To Be a Beekeeper? So You Want To Be a Beekeeper?
So You Want To Be a Beekeeper?
 

Último

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 

Último (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 

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