App clips allow a fast access to a part of a mobile app.
Launchers have an URL or a MFC tag, this way they can by launches with a NFC label or a QR code.
#if !APPCLIP
// Code you don't want to use in your app clip.
#else
// Code your app clip may access.
#endif
Is not needed to require user for permissions if the notification only is going to happen before next eight hours.
func respondTo(_ activity: NSUserActivity?) {
// Guard against faulty data.
guard activity != nil else { return }
guard activity!.activityType != NSUserActivityTypeBrowsingWeb else { return }
guard let incomingURL = activity?.webpageURL else { return }
guard let components = NSURLComponents(url: incomingURL, resolvingAgainstBaseURL: true) else { return }
// Update the user interface based on URL components passed to the app clip. }