π 2019.11.20 (WED)
WWDC2015 | Session : 509 | Category : Safari and Web
π Seamless Linking to Your App - WWDC 2015 - Videos - Apple Developer
Often web content mirrors app content
An app exists as part of an ecosystem
If your app, or website, needs to access content provided by another app, or website, it needs to communicate with it somehow
Custom URL schemes
- Let apps communicate with each other
- Don't always map to your app Two apps can claim the same URL scheme
- Don't work without your app installed
- Don't protect users' privacy
β¬οΈβ¬οΈβ¬οΈ
- Let apps communicate with each other just as easily There should be a strong two-way association between your app and your URLs.
- Securely map to apps you choose
- Work Universally, fall back to Safari Safari, and web browsers in general, are a great way to display rich content, and are present on nearly every platform, so we'll make sure that these links can open in a web browser.
- Protect users' privacy There is no need for a third party to be involved.
https://developer.apple.com/videos/wwdc/2014/?include=101#101
- Scheme : "https" or "http"
- Domain(or Host name) : developer.apple.com β The domain is securely associated with your app, by using an SSL certificate to sign a file that is stored on your secure web server.
- Path or path prefix : /videos/wwdc/2014/ β The path can either match exactly, or it can match with a prefix.
Universal links mean having your app, not Safari, handle links to your website, but in order to get in order to open your app, when a user taps a link to your website, iOS needs to know that your app should open that link.
- Create your "apple-app-site-association" file
- Generate an SSL certificate
- Sign your file
- Upload to your server
func application(application: UIApplication, continueUserActivity
userActivity, NSUserActivity, restorationHandler: ([AnyObject]!) -> Void) ->
Bool
var webpageURL: NSURL?
var activityType: String
let NSUserActivityTypeBroswingWeb: String
Project Setting β Capabilities tab β select associated domains
- Validate input
- Fail gracefully
- Send data over HTTPS
π Networking with NSURLSession https://developer.apple.com/videos/play/wwdc2015/711
- No flashes or bouncing through Safari
- No code required on your website
- Graceful fallback to Safari
- Platform-neutral
- No extra sever round-trips
- Full user privacy protection
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.
- Securely save credentials for users
- Sync to all devices with iCloud Keychain
- Suggest secure passwords for users
- AutoFill saved credentials
- Associate your app and your website
- Teach your app to ask for Shared Web
- Credentials