seamless linking to your app...custom url schemes let apps communicate with each other don‘t...
TRANSCRIPT
![Page 1: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/1.jpg)
© 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.
#WWDC15
Seamless Linking to Your App
Conrad Shultz Safari and WebKit Software EngineerJonathan Grynspan Core Services Software Engineer
App Frameworks
Session 509
![Page 2: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/2.jpg)
Your App, Your Website
![Page 3: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/3.jpg)
DemoWWDC App
Conrad Shultz Safari and WebKit Software Engineer
![Page 4: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/4.jpg)
Building Seamless Integration
Have your app handle link to your websiteHave your website link to your appHelp your users log into your app
![Page 5: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/5.jpg)
Building Seamless Integration
Have your app handle link to your websiteHave your website link to your appHelp your users log into your app
![Page 6: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/6.jpg)
Building Seamless Integration
Have your app handle link to your websiteHave your website link to your appHelp your users log into your app
![Page 7: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/7.jpg)
Building Seamless Integration
Have your app handle link to your websiteHave your website link to your appHelp your users log into your app
![Page 8: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/8.jpg)
Linking to Your App
Jonathan GrynspanCore Services Software Engineer
![Page 9: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/9.jpg)
![Page 10: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/10.jpg)
![Page 11: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/11.jpg)
![Page 12: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/12.jpg)
![Page 13: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/13.jpg)
![Page 14: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/14.jpg)
![Page 15: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/15.jpg)
Handling URLs in Your App
![Page 16: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/16.jpg)
Handling URLs in Your AppCustom URL schemes
![Page 17: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/17.jpg)
Handling URLs in Your AppCustom URL schemes
Let apps communicate with each other
![Page 18: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/18.jpg)
Handling URLs in Your AppCustom URL schemes
Let apps communicate with each otherDon‘t always map to your app
![Page 19: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/19.jpg)
Handling URLs in Your AppCustom URL schemes
Let apps communicate with each otherDon‘t always map to your appDon‘t work without your app installed
![Page 20: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/20.jpg)
Handling URLs in Your AppCustom URL schemes
Let apps communicate with each otherDon‘t always map to your appDon‘t work without your app installedDon‘t protect users‘ privacy
![Page 21: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/21.jpg)
Let apps communicate with each otherDon‘t always map to your appDon‘t work without your app installedDon‘t protect users‘ privacy
Handling URLs in Your AppA better way?
![Page 22: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/22.jpg)
Let apps communicate with each otherDon‘t always map to your appDon‘t work without your app installedDon‘t protect users‘ privacy
Let apps communicate with each other just as easily
Handling URLs in Your AppA better way?
![Page 23: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/23.jpg)
Handling URLs in Your AppA better way?
Let apps communicate with each other just as easilyDon‘t always map to your appDon‘t work without your app installedDon‘t protect users‘ privacy
![Page 24: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/24.jpg)
Handling URLs in Your AppA better way?
Let apps communicate with each other just as easilyDon‘t always map to your appDon‘t work without your app installedDon‘t protect users‘ privacy
Securely map to apps you choose
![Page 25: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/25.jpg)
Handling URLs in Your AppA better way?
Let apps communicate with each other just as easilySecurely map to apps you chooseDon‘t work without your app installedDon‘t protect users‘ privacy
![Page 26: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/26.jpg)
Handling URLs in Your AppA better way?
Let apps communicate with each other just as easilySecurely map to apps you chooseDon‘t work without your app installedDon‘t protect users‘ privacyWork universally, fall back to Safari
![Page 27: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/27.jpg)
Handling URLs in Your AppA better way?
Let apps communicate with each other just as easilySecurely map to apps you chooseWork universally, fall back to SafariDon‘t protect users‘ privacy
![Page 28: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/28.jpg)
Handling URLs in Your AppA better way?
Let apps communicate with each other just as easilySecurely map to apps you chooseWork universally, fall back to SafariDon‘t protect users‘ privacyProtect users‘ privacy
A better way
![Page 29: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/29.jpg)
Breakdown of a Universal Link
![Page 30: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/30.jpg)
Breakdown of a Universal Link
https://developer.apple.com/videos/wwdc/2014/?include=101#101
![Page 31: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/31.jpg)
Breakdown of a Universal Link
https://developer.apple.com/videos/wwdc/2014/?include=101#101
Scheme (”https“ or “http”)
![Page 32: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/32.jpg)
Breakdown of a Universal Link
https://developer.apple.com/videos/wwdc/2014/?include=101#101
Domain
![Page 33: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/33.jpg)
Breakdown of a Universal Link
https://developer.apple.com/videos/wwdc/2014/?include=101#101
Path or path prefix
![Page 34: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/34.jpg)
Breakdown of a Universal Link
https://developer.apple.com/videos/wwdc/2014/?include=101#101
![Page 35: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/35.jpg)
![Page 36: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/36.jpg)
Getting Your Server Ready
![Page 37: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/37.jpg)
Getting Your Server Ready
Create your “apple-app-site-association” fileGenerate an SSL certificateSign your fileUpload to your server
![Page 38: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/38.jpg)
Getting Your Server Ready“apple-app-site-association” file
{ "applinks": { "apps": [], "details": { "9JA89QQLNQ.com.apple.wwdc": { "paths": [ "*" ] } } }}
![Page 39: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/39.jpg)
Getting Your Server Ready“apple-app-site-association” file
{ "applinks": { "apps": [], "details": { "9JA89QQLNQ.com.apple.wwdc": { "paths": [ "*" ] } } }}
![Page 40: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/40.jpg)
{ "applinks": { "apps": [], "details": { "9JA89QQLNQ.com.apple.wwdc": { "paths": [ "*" ] } } }}
Getting Your Server Ready“apple-app-site-association” file
![Page 41: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/41.jpg)
{ "applinks": { "apps": [], "details": { "9JA89QQLNQ.com.apple.wwdc": { "paths": [ "*" ]
Getting Your Server Ready“apple-app-site-association” file
} } }}
![Page 42: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/42.jpg)
{ "applinks": { "apps": [], "details": { "9JA89QQLNQ.com.apple.wwdc": { "paths": [ "*" ]
Getting Your Server Ready“apple-app-site-association” file
"/wwdc/news/", "/videos/wwdc/2015/*" ]
"paths": [
} } }}
![Page 43: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/43.jpg)
Getting Your Server Ready
Create your “apple-app-site-association” fileGenerate an SSL certificateSign your fileUpload to your server
![Page 44: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/44.jpg)
Getting Your Server Ready
Create your “apple-app-site-association” fileGenerate an SSL certificateSign your fileUpload to your server
![Page 45: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/45.jpg)
Getting Your Server ReadySigning your JSON file
openssl smime \ -sign \ -nodetach \ -in "unsigned.json" \ -out "apple-app-site-association" \ -outform DER \ -inkey "private-key.pem" \ -signer "certificate.pem"
![Page 46: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/46.jpg)
Getting Your Server ReadySigning your JSON file
openssl smime \ -sign \ -nodetach \ -in "unsigned.json" \ -out "apple-app-site-association" \ -outform DER \ -inkey "private-key.pem" \ -signer "certificate.pem"
![Page 47: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/47.jpg)
openssl smime \ -sign \ -nodetach \ -in "unsigned.json" \ -out "apple-app-site-association" \ -outform DER \ -inkey "private-key.pem" \ -signer "certificate.pem"
Getting Your Server ReadySigning your JSON file
![Page 48: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/48.jpg)
openssl smime \ -sign \ -nodetach \ -in "unsigned.json" \ -out "apple-app-site-association" \ -outform DER \ -inkey "private-key.pem" \ -signer "certificate.pem" \
-certfile "intermediate-certificate.pem"
Getting Your Server ReadySigning your JSON file
![Page 49: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/49.jpg)
Getting Your Server Ready
Create your “apple-app-site-association” fileGenerate an SSL certificateSign your fileUpload to your server
![Page 50: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/50.jpg)
Getting Your Server Ready
Create your “apple-app-site-association” fileGenerate an SSL certificateSign your fileUpload to your server
https://www.example.com/apple-app-site-association
![Page 51: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/51.jpg)
Getting Your Server Ready
Create your “apple-app-site-association” fileGenerate an SSL certificateSign your fileUpload to your server
![Page 52: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/52.jpg)
Getting Your Server Ready
Create your “apple-app-site-association” file Upload to your server
![Page 53: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/53.jpg)
Getting Your App Ready
![Page 54: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/54.jpg)
Getting Your App ReadyUIApplicationDelegate support
![Page 55: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/55.jpg)
Getting Your App ReadyUIApplicationDelegate support
func application(application: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]!) -> Void) -> Bool
![Page 56: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/56.jpg)
Getting Your App ReadyUIApplicationDelegate support
func application(application: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]!) -> Void) -> Bool
var webpageURL : NSURL?
![Page 57: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/57.jpg)
Getting Your App ReadyUIApplicationDelegate support
func application(application: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]!) -> Void) -> Bool
var webpageURL : NSURL?
var activityType : String
![Page 58: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/58.jpg)
Getting Your App ReadyUIApplicationDelegate support
func application(application: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]!) -> Void) -> Bool
var webpageURL : NSURL?
var activityType : String
let NSUserActivityTypeBrowsingWeb : String
![Page 59: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/59.jpg)
Getting Your App ReadyUIApplicationDelegate support
func application(application: UIApplication, continueUserActivity userActivity: NSUserActivity, restorationHandler: ([AnyObject]!) -> Void) -> Bool
var webpageURL : NSURL?
var activityType : String
let NSUserActivityTypeBrowsingWeb : String
class NSURLComponents : NSObject
![Page 60: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/60.jpg)
Getting Your App ReadyConfiguring your associated domains
![Page 61: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/61.jpg)
Getting Your App ReadyBest practices
![Page 62: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/62.jpg)
Getting Your App ReadyBest practices
Validate input
![Page 63: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/63.jpg)
Getting Your App ReadyBest practices
Validate inputFail gracefully
![Page 64: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/64.jpg)
Getting Your App ReadyBest practices
Validate inputFail gracefullySend data over HTTPS
![Page 65: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/65.jpg)
Getting Your App ReadyBest practices
Validate inputFail gracefullySend data over HTTPS
![Page 66: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/66.jpg)
Getting Your App ReadyBest practices
Validate inputFail gracefullySend data over HTTPS
Networking with NSURLSession Pacific Heights Thursday 9:00AM
![Page 67: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/67.jpg)
DemoXcode and iOS 9 SDK
Jonathan GrynspanCore Services Software Engineer
![Page 68: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/68.jpg)
Linking to Your App
Conrad Shultz Safari and WebKit Software Engineer
![Page 69: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/69.jpg)
Linking to Your AppSome advantages of universal links
No flashes or bouncing through SafariNo code required on your websiteGraceful fallback to SafariPlatform-neutralNo extra server round-tripsFull user privacy protection
![Page 70: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/70.jpg)
Linking to Your AppSome advantages of universal links
No flashes or bouncing through SafariNo code required on your websiteGraceful fallback to SafariPlatform-neutralNo extra server round-tripsFull user privacy protection
![Page 71: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/71.jpg)
Linking to Your AppSome advantages of universal links
No flashes or bouncing through SafariNo code required on your websiteGraceful fallback to SafariPlatform-neutralNo extra server round-tripsFull user privacy protection
![Page 72: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/72.jpg)
Linking to Your AppSome advantages of universal links
No flashes or bouncing through SafariNo code required on your websiteGraceful fallback to SafariPlatform-neutralNo extra server round-tripsFull user privacy protection
![Page 73: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/73.jpg)
Linking to Your AppSome advantages of universal links
No flashes or bouncing through SafariNo code required on your websiteGraceful fallback to SafariPlatform-neutralNo extra server round-tripsFull user privacy protection
![Page 74: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/74.jpg)
Linking to Your AppSome advantages of universal links
No flashes or bouncing through SafariNo code required on your websiteGraceful fallback to SafariPlatform-neutralNo extra server round-tripsFull user privacy protection
![Page 75: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/75.jpg)
Linking to Your AppSome advantages of universal links
No flashes or bouncing through SafariNo code required on your websiteGraceful fallback to SafariPlatform-neutralNo extra server round-tripsFull user privacy protection
![Page 76: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/76.jpg)
Smart App BannersPromote your app from your website
![Page 77: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/77.jpg)
Smart App BannersWhat are smart app banners?
Presented by Safari on iOSKnow whether an app is installedEasy to add to your websiteUsed to index your appMore effective than custom URL schemes
![Page 78: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/78.jpg)
Smart App BannersWhat are smart app banners?
Presented by Safari on iOSKnow whether an app is installedEasy to add to your websiteUsed to index your appMore effective than custom URL schemes
![Page 79: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/79.jpg)
Smart App BannersWhat are smart app banners?
Presented by Safari on iOSKnow whether an app is installedEasy to add to your websiteUsed to index your appMore effective than custom URL schemes
![Page 80: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/80.jpg)
Smart App BannersWhat are smart app banners?
Presented by Safari on iOSKnow whether an app is installedEasy to add to your websiteUsed to index your appMore effective than custom URL schemes
![Page 81: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/81.jpg)
Smart App BannersWhat are smart app banners?
Presented by Safari on iOSKnow whether an app is installedEasy to add to your websiteUsed to index your appMore effective than custom URL schemes
![Page 82: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/82.jpg)
Smart App BannersWhat are smart app banners?
Presented by Safari on iOSKnow whether an app is installedEasy to add to your websiteUsed to index your appMore effective than custom URL schemes
![Page 83: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/83.jpg)
Smart App BannersDeploying smart app banners
Add a meta tag to your website’s head: <head>
<meta name="apple-itunes-app" content="app-id=640199958, app-argument=https://developer.apple.com/wwdc/schedule, affiliate-data=optionalAffiliateData">
</head>
![Page 84: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/84.jpg)
Smart App BannersDeploying smart app banners
Add a meta tag to your website’s head: <head>
<meta name="apple-itunes-app" content="app-id=640199958, app-argument=https://developer.apple.com/wwdc/schedule, affiliate-data=optionalAffiliateData">
</head>
![Page 85: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/85.jpg)
Smart App BannersDeploying smart app banners
Add a meta tag to your website’s head: <head>
<meta name="apple-itunes-app" content="app-id=640199958, app-argument=https://developer.apple.com/wwdc/schedule, affiliate-data=optionalAffiliateData">
</head>
![Page 86: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/86.jpg)
Smart App BannersDeploying smart app banners
Add a meta tag to your website’s head: <head>
<meta name="apple-itunes-app" content="app-id=640199958, app-argument=https://developer.apple.com/wwdc/schedule, affiliate-data=optionalAffiliateData">
</head>
Use https://linkmaker.itunes.apple.com to find your App Store ID
![Page 87: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/87.jpg)
Smart App BannersDeploying smart app banners
Add a meta tag to your website’s head: <head>
<meta name="apple-itunes-app" content="app-id=640199958, app-argument=https://developer.apple.com/wwdc/schedule, affiliate-data=optionalAffiliateData">
</head>
![Page 88: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/88.jpg)
Smart App BannersDeploying smart app banners
Add a meta tag to your website’s head: <head>
<meta name="apple-itunes-app" content="app-id=640199958, app-argument=https://developer.apple.com/wwdc/schedule, affiliate-data=optionalAffiliateData">
</head>
app-argument is passed to application(_:openURL:sourceApplication:annotation:), and is also used to index your app
![Page 89: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/89.jpg)
Smart App BannersDeploying smart app banners
Add a meta tag to your website’s head: <head>
<meta name="apple-itunes-app" content="app-id=640199958, app-argument=https://developer.apple.com/wwdc/schedule, affiliate-data=optionalAffiliateData">
</head>
app-argument is passed to application(_:openURL:sourceApplication:annotation:), and is also used to index your app
Introducing Search APIs Mission Wednesday 11:00AM
![Page 90: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/90.jpg)
Smart App BannersDeploying smart app banners
Add a meta tag to your website’s head: <head>
<meta name=“apple-itunes-app" content="app-id=640199958, app-argument=https://developer.apple.com/wwdc/schedule, affiliate-data=optionalAffiliateData">
</head>
Smart App Banners will not appear in the iOS Simulator
![Page 92: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/92.jpg)
![Page 93: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/93.jpg)
![Page 94: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/94.jpg)
![Page 95: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/95.jpg)
Shared Web CredentialsHelp your users log into your app
![Page 96: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/96.jpg)
Saved Passwords and SafariHow Safari helps users—and you
Securely save credentials for usersSync to all devices with iCloud KeychainSuggest secure passwords for usersAutoFill saved credentials
![Page 97: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/97.jpg)
Saved Passwords and SafariHow Safari helps users—and you
Securely save credentials for usersSync to all devices with iCloud KeychainSuggest secure passwords for usersAutoFill saved credentials
![Page 98: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/98.jpg)
Saved Passwords and SafariHow Safari helps users—and you
Securely save credentials for usersSync to all devices with iCloud KeychainSuggest secure passwords for usersAutoFill saved credentials
![Page 99: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/99.jpg)
Saved Passwords and SafariHow Safari helps users—and you
Securely save credentials for usersSync to all devices with iCloud KeychainSuggest secure passwords for usersAutoFill saved credentials
![Page 100: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/100.jpg)
Saved Passwords and SafariHow Safari helps users—and you
Securely save credentials for usersSync to all devices with iCloud KeychainSuggest secure passwords for usersAutoFill saved credentials
![Page 101: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/101.jpg)
Shared Web CredentialsAdopting shared web credentials
Associate your app and your websiteTeach your app to ask for Shared Web Credentials
![Page 102: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/102.jpg)
Shared Web CredentialsAdopting shared web credentials
Associate your app and your websiteTeach your app to ask for Shared Web Credentials
![Page 103: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/103.jpg)
Shared Web CredentialsAdopting shared web credentials
Associate your app and your websiteTeach your app to ask for Shared Web Credentials
![Page 104: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/104.jpg)
App-Website AssociationServer-side
![Page 105: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/105.jpg)
App-Website AssociationServer-side
Add a new top-level dictionary to your apple-app-site-association JSON file: { "applinks": { "apps": [], "details": { "9JA89QQLNQ.com.apple.wwdc": { "paths": [ "/wwdc/news/", "/videos/wwdc/2015/*" ] } } }
}
![Page 106: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/106.jpg)
App-Website AssociationServer-side
Add a new top-level dictionary to your apple-app-site-association JSON file: { "applinks": {
}
}
… }
"webcredentials": {
"apps": [ "A1B2C3D4E5.com.example.AppName" ]
}
![Page 107: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/107.jpg)
App-Website AssociationServer-side
Add a new top-level dictionary to your apple-app-site-association JSON file: { "applinks": { … }
"webcredentials": {
"apps": [ "A1B2C3D4E5.com.example.AppName" ]
} }
![Page 108: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/108.jpg)
App-Website AssociationServer-side
Add a new top-level dictionary to your apple-app-site-association JSON file: { "applinks": { … }
"webcredentials": {
"apps": [ "A1B2C3D4E5.com.example.AppName" ]
} }
![Page 109: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/109.jpg)
App-Website AssociationApp-side
![Page 110: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/110.jpg)
App-Website AssociationApp-side
Add a new entry to your app’s com.apple.developer.associated-domains entitlement: webcredentials:example.com
![Page 111: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/111.jpg)
App-Website AssociationApp-side
Add a new entry to your app’s com.apple.developer.associated-domains entitlement: webcredentials:example.com
![Page 112: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/112.jpg)
Shared Web CredentialsThe app workflow
Log In
Save Credentials
Prompt User
Check Safari for Credentials
Check for Saved Credentials
![Page 113: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/113.jpg)
Shared Web CredentialsThe app workflow
Log In
Save Credentials
Prompt User
Check Safari for Credentials
Check for Saved Credentials
![Page 114: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/114.jpg)
Shared Web CredentialsThe app workflow
Log In
Save Credentials
Prompt User
Check Safari for Credentials
Check for Saved Credentials
Check Safari for Credentials
![Page 115: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/115.jpg)
Shared Web CredentialsThe app workflow
Log In
Save Credentials
Prompt User
Check Safari for Credentials
Check for Saved Credentials
![Page 116: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/116.jpg)
Retrieving Safari’s Saved Credentials
// Find all matching user names from domains specified in the entitlement. SecRequestSharedWebCredential(nil, nil) { cfCredentials, error in if let cfCredentials = cfCredentials where CFArrayGetCount(cfCredentials) != 0 { let credentials = cfCredentials as [AnyObject] let credential = credentials[0] let userName = credential[kSecAttrAccount as String] let password = credential[kSecSharedPassword as String] dispatch_async(dispatch_get_main_queue()) { // Log in with the user name and password. } } else { dispatch_async(dispatch_get_main_queue()) { // Show in-app login UI. } } }
![Page 117: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/117.jpg)
Retrieving Safari’s Saved Credentials
// Find all matching user names from domains specified in the entitlement. SecRequestSharedWebCredential(nil, nil) { cfCredentials, error in if let cfCredentials = cfCredentials where CFArrayGetCount(cfCredentials) != 0 { let credentials = cfCredentials as [AnyObject] let credential = credentials[0] let userName = credential[kSecAttrAccount as String] let password = credential[kSecSharedPassword as String] dispatch_async(dispatch_get_main_queue()) { // Log in with the user name and password. } } else { dispatch_async(dispatch_get_main_queue()) { // Show in-app login UI. } } }
![Page 118: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/118.jpg)
Retrieving Safari’s Saved Credentials
// Find all matching user names from domains specified in the entitlement. SecRequestSharedWebCredential(nil, nil) { cfCredentials, error in if let cfCredentials = cfCredentials where CFArrayGetCount(cfCredentials) != 0 { let credentials = cfCredentials as [AnyObject] let credential = credentials[0] let userName = credential[kSecAttrAccount as String] let password = credential[kSecSharedPassword as String] dispatch_async(dispatch_get_main_queue()) { // Log in with the user name and password. } } else { dispatch_async(dispatch_get_main_queue()) { // Show in-app login UI. } } }
![Page 119: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/119.jpg)
Retrieving Safari’s Saved Credentials
// Find all matching user names from domains specified in the entitlement. SecRequestSharedWebCredential(nil, nil) { cfCredentials, error in if let cfCredentials = cfCredentials where CFArrayGetCount(cfCredentials) != 0 { let credentials = cfCredentials as [AnyObject] let credential = credentials[0] let userName = credential[kSecAttrAccount as String] let password = credential[kSecSharedPassword as String] dispatch_async(dispatch_get_main_queue()) { // Log in with the user name and password. } } else { dispatch_async(dispatch_get_main_queue()) { // Show in-app login UI. } } }
![Page 120: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/120.jpg)
Retrieving Safari’s Saved Credentials
// Find all matching user names from domains specified in the entitlement. SecRequestSharedWebCredential(nil, nil) { cfCredentials, error in if let cfCredentials = cfCredentials where CFArrayGetCount(cfCredentials) != 0 { let credentials = cfCredentials as [AnyObject] let credential = credentials[0] let userName = credential[kSecAttrAccount as String] let password = credential[kSecSharedPassword as String] dispatch_async(dispatch_get_main_queue()) { // Log in with the user name and password. } } else { dispatch_async(dispatch_get_main_queue()) { // Show in-app login UI. } } }
![Page 121: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/121.jpg)
Retrieving Safari’s Saved Credentials
// Find all matching user names from domains specified in the entitlement. SecRequestSharedWebCredential(nil, nil) { cfCredentials, error in if let cfCredentials = cfCredentials where CFArrayGetCount(cfCredentials) != 0 { let credentials = cfCredentials as [AnyObject] let credential = credentials[0] let userName = credential[kSecAttrAccount as String] let password = credential[kSecSharedPassword as String] dispatch_async(dispatch_get_main_queue()) { // Log in with the user name and password. } } else { dispatch_async(dispatch_get_main_queue()) { // Show in-app login UI. } } }
![Page 122: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/122.jpg)
Retrieving Safari’s Saved Credentials
// Find all matching user names from domains specified in the entitlement. SecRequestSharedWebCredential(nil, nil) { cfCredentials, error in if let cfCredentials = cfCredentials where CFArrayGetCount(cfCredentials) != 0 { let credentials = cfCredentials as [AnyObject] let credential = credentials[0] let userName = credential[kSecAttrAccount as String] let password = credential[kSecSharedPassword as String] dispatch_async(dispatch_get_main_queue()) { // Log in with the user name and password. } } else { dispatch_async(dispatch_get_main_queue()) { // Show in-app login UI. } } }
![Page 123: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/123.jpg)
Retrieving Safari’s Saved Credentials
// Find all matching user names from domains specified in the entitlement. SecRequestSharedWebCredential(nil, nil) { cfCredentials, error in if let cfCredentials = cfCredentials where CFArrayGetCount(cfCredentials) != 0 { let credentials = cfCredentials as [AnyObject] let credential = credentials[0] let userName = credential[kSecAttrAccount as String] let password = credential[kSecSharedPassword as String] dispatch_async(dispatch_get_main_queue()) { // Log in with the user name and password. } } else { dispatch_async(dispatch_get_main_queue()) { // Show in-app login UI. } } }
![Page 124: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/124.jpg)
Shared Web CredentialsUpdating Safari’s saved credentials
SecAddSharedWebCredential("example.com", userName, password) { error in }
![Page 125: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/125.jpg)
let password: String = SecCreateSharedWebCredentialPassword().takeRetainedValue() as String print("The generated password was: \(password)") // E.g.: The generated password was: uFA-T9C-aRD-cDP
Shared Web CredentialsGenerating secure passwords
![Page 126: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/126.jpg)
let password: String = SecCreateSharedWebCredentialPassword().takeRetainedValue() as String print("The generated password was: \(password)") // E.g.: The generated password was: uFA-T9C-aRD-cDP
Shared Web CredentialsGenerating secure passwords
Your App, Your Website, and Safari WWDC14
![Page 127: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/127.jpg)
Summary
Give your users the best experience by having your app handle link to your websiteDeploy Smart App Banners to help users of your website discover your appHelp your users log into your app by adopting Shared Web Credentials
![Page 128: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/128.jpg)
Summary
Give your users the best experience by having your app handle link to your websiteDeploy Smart App Banners to help users of your website discover your appHelp your users log into your app by adopting Shared Web Credentials
![Page 129: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/129.jpg)
Summary
Give your users the best experience by having your app handle link to your websiteDeploy Smart App Banners to help users of your website discover your appHelp your users log into your app by adopting Shared Web Credentials
![Page 130: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/130.jpg)
Summary
Give your users the best experience by having your app handle links to your websiteDeploy Smart App Banners to help users of your website discover your appHelp your users log into your app by adopting Shared Web Credentials
![Page 131: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/131.jpg)
More Information
Technical SupportApple Developer Forumshttp://developer.apple.com/forums
Developer Technical Supporthttp://developer.apple.com/contact
Shared Web Credentials Referencehttp://developer.apple.com/library/ios/documentation/Security/Reference/SharedWebCredentialsRef/
![Page 132: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/132.jpg)
More Information
General InquiriesJon Davis Web Technologies [email protected]
Jake Behrens App Frameworks [email protected]
![Page 133: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/133.jpg)
Related Sessions
Introducing Safari View Controller Nob Hill Tuesday 1:30PM
Privacy and Your App Pacific Heights Tuesday 2:30PM
Introducing Search APIs Mission Wednesday 11:00AM
Networking with NSURLSession Pacific Heights Thursday 9:00AM
Your App, Your Website, and Safari WWDC14
Adopting Handoff on iOS and OS X WWDC14
![Page 134: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/134.jpg)
Labs
App Search and Spotlight Frameworks Lab E Friday 1:30PM
Safari and WebKit Graphics, Games, and Media Lab A Friday 12:00PM
![Page 135: Seamless Linking to Your App...Custom URL schemes Let apps communicate with each other Don‘t always map to your app Don‘t work without your app installed Don‘t protect users‘](https://reader034.vdocuments.net/reader034/viewer/2022050519/5fa33aad5f8abc55020d27fe/html5/thumbnails/135.jpg)