Skip to content

Instantly share code, notes, and snippets.

@fluffyemily
Created June 18, 2015 14:41
Show Gist options
  • Save fluffyemily/a40c7c643e166f97bfad to your computer and use it in GitHub Desktop.
Save fluffyemily/a40c7c643e166f97bfad to your computer and use it in GitHub Desktop.
background fetch
func application(application: UIApplication, performFetchWithCompletionHandler completionHandler: (UIBackgroundFetchResult) -> Void) {
let delegate = BrowserProfileSyncDelegate(app: UIApplication.sharedApplication())
delegate.displaySentTabForURL(NSURL(string: "http://mozilla.com")!, title: "Mozilla")
completionHandler(.NewData)
}
@fluffyemily
Copy link
Author

Enable Background fetch in Capabilities and add this to the AppDelegate. Then run the project and, in XCode run Debug -> Simulate Background Fetch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment