Skip to content

robertmryan/BGAppRefresh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Demo of iOS BGAppRefresh

This is example of BGAppRefreshTaskRequest in the Background Tasks framework.

This does the following:

  • Registers the background task in the app delegate’s didFinishLaunchingWithOptions.
  • Schedules the BGAppRefreshTaskRequest in the scene delegate’s sceneDidEnterBackground.
  • All the background task related code is placed in BackgroundTaskManager class to avoid cluttering the app delegate and the scene delegate.
  • The app refresh just does a simple request to https://httpbin.org.
  • All relevant events are logged using Logger (which allows you to watch these iOS events happen on your macOS Console). This is for iOS 14 and later. If you need to support iOS 13, then use os_log instead.
  • This posts UserNotification events so you can also see what’s happening from the device, too.
  • I have added a #warning where you may want to add a breakpoint if you want to test this on physical device.

See:


19 January 2021

Copyright © 2021 Robert M. Ryan. All Rights Reserved.

See License.

About

Demo of iOS app refresh

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages