SlideShare une entreprise Scribd logo
1  sur  20
Télécharger pour lire hors ligne
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

Contenu connexe

Plus de Jonathan Engelsma

Plus 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?
 

Dernier

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Dernier (20)

Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
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
 
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
 
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
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
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...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
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
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
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
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.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
 

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