0

Do Widgets in iOS 11 run in the foreground or background?

Are Widgets updated/call the containing app when the Today View or Notification Center is simply interacted with on an iPhone? or must the Widget be physically touched/selected to update or communicate with the containing app?

Haroldo Gondim
  • 7,725
  • 9
  • 43
  • 62
Stephen
  • 1
  • 1
  • 1
    Did you try anything? Please post your sample code. – Erçin Dedeoğlu Feb 05 '18 at 19:22
  • No we have not yet - we are trying to get around iOS 11 from killing our app in the background. We need to get notified of location updates only once our users have started travelling significant distances and then more granular tracking once they enter a very small geo-fence. We dont want to track our users otherwise. We are simply trying to have the users check into a gym without using Wi-Fi or bluetooth beacons..have our app work in background using location services but only once they are close to the location...and avoid iOS terminating our app before it gets there – Stephen Feb 06 '18 at 03:54

1 Answers1

0

Widgets are small apps containing all the business logic, networking and UI elements.

When user sees the widget, widgetPerformUpdate(completionHandler:) method gets called and at this instance we have to update its data.

There is limited functionality available for data sharing & interaction between widget and the application and very little memory is provided for widget so it needs to be light in weight without big third party frameworks.

Have a look at this tutorial to get you started: https://www.raywenderlich.com/150953/today-extension-tutorial-getting-started

atulkhatri
  • 10,896
  • 3
  • 53
  • 89