The purpose of this project is for me to gain experience with:
- Sharing data between mulitple apps via App Groups.
- Determining the approximate frequency of Background Fetch events in both iOS 10 and iOS 11.
- Extracting common code into a framework to access from multiple app projects within an Xcode Workspace.
I've done this by setting up an AppGroupsFun.xcworkspace with the following projects:
- BackgroundFetchEvents framework used to share common code between the other two projects.
- BackgroundFetchWriter app which registers for Background Fetch events, logs each event to a shared UserDefaults instance via App Groups, and posts a local UserNotification on each background fetch event.
- BackgroundFetchReader app which displays background fetch log created by Writer app.
You will need to add your own App Groups container identifier via the Capabilities pane in both Writer and Reader projects. You will also need to Update the sharedUserDefaults suiteName parameter in BackgroundFetchEventProvider.swift (around line 24) to use your new identifier.