GithubHelp home page GithubHelp logo

jaanesen / background-app Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 1.0 359 KB

Simple application for testing the observer query's background functionality. The work was done as part of my master thesis.

License: MIT License

Swift 100.00%
observer-query apple healthkit background-app

background-app's Introduction

Background-App

Simple application for testing the observer query's background functionality. The work was done as part of my master thesis.

Flow

The application's main flow is the column on the right, which describes the events leading to a notification being dispatched. The left side concerns the actual application on the phone with setup, including authorizing User Notification- and HealthKit frameworks and the application instantiating the background observer query. henever a new resting heart rate value is stored or the existing value is updated, the HealthKit framework will trigger the observer query's update handler. The update handler will then call for a statistics collection query that updates the app's existing variables. If the resting heart rate is, in fact, changed, it will schedule a notification in the notification center. The notification is then supposed to be dispatched, and it is possible to verify if the background functionality is working or not.

Class diagram

This application has the same user interface as the Resting Heart Rate App and has some identical elements in the class diagram.

  • [V-1,2,3,4,5] the same as in the Resting Heart Rate App.
  • [F-1] Start function. Initializes the application by calling F-4 to authorize the required HealthKit permissions, and F-5 to authorize the use of User Notifications. When the required permissions are obtained, the function starts the observer query by calling F-2.
  • [F-2] Start observer query function. This function initializes an observer query with a completion handler which calls the F-3 function to fetch the observed change in resting heart rate.
  • [F-3] Run heart rate query function. Checks the fetched HR and calls F-6 with the required parameters to dispatch a notification.
  • [F-4] Handles permission to read/write health-related data, specifically in this example: resting heart rate.
  • [F-5] Handles permission to display notifications.
  • [F-6] Notification dispatching function. With two additional parameters: title: String, body: String.
  • [A-1] Red line illustrates F-1 calling F-4 and F-5.
  • [A-2] Green line illustrates F-2 calling F-3 every time the observer query is triggered.

background-app's People

Contributors

jaanesen avatar

Watchers

 avatar

Forkers

archananeupane

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.