Giter VIP home page Giter VIP logo

ios-bg-files's Introduction

Overview

This is a sample iOS application to monitor directory changes in the background.

Video

The video depicts adding/removing files using iTunes File sharing feature. iPhone is running iOS10.

YouTube video

Preview

Here's a short preview if you can't open YouTube for some reason:

Short preview

Details

  • Background execution is achieved by requesting 'Always' location updates.
  • File changes are tracked with GCD descriptor dispatch source.
  • Notifications are reported using local notifications.

Things to improve

There are a few things that can be improved. However, since this is only a sample, they are left out.

  • Waiting for changes to finish. There are several use cases where reporting right away does not make much sense

    • When several files are added or removed, there is a notification for each one of them
    • When a large file is added, notification is reported before the file has been uploaded
  • Supporting UNUserNotificationCenter

    • UILocalNotification is deprecated in iOS10, but still works
    • NotificationWithLNAndUNC directory contains an attempt to use UNC if it's supported, but since the async nature of UNUserNotificationCenter getNotificationSettingsWithCompletionHandler: ruins the pretty interface of Notification class, I decided to stay with UILocalNotification

References

Here are some of the docs I used to implement the sample.

ios-bg-files's People

Contributors

kornerr avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.