Coder Social home page Coder Social logo

vodapp's Introduction

VODApp

The project illustrate an approach to handle a push notification having in the payload a list of media items to be downloaded on background. Its not necesary handle all app states (foreground, suspended, or even terminated by the system). Declaring the background modes, push notification its enought.

Apps that declare appropriate background modes can use default URL sessions and data tasks, just as if they were in the foreground.`

the push notification must be marked as silent. content-available : 1, heres an example

    "aps" : {
        "content-available" : 1
    },
    "playlist" : {
        "f3058e6662927f1fcd17840469cfd5f3" : {
            "title" : "Tulips",
            "url" : "https:\/\/my.domain.com\/media\/sample4.mp4"
        },
        "05747156e369eff34cbecb40a2adda6a" : {
            "title" : "Unicorns and horses spining around",
            "url" : "https:\/\/my.domain.com\/media\/sample2.mp4"
        },
        "27da99954cbcf488fb02a145079f3bb9" : {
            "title" : "Big Buck Bunny Movie",
            "subtitle" : "Animated movie yeah",
            "url" : "https:\/\/my.domain.com\/media\/sample5.mp4"
        },
        "f61c3d7f92b199ed7f5812781ccba06f" : {
            "title" : "Superb sunset - Miami Beach 2017",
            "url" : "https:\/\/my.domain.com\/media\/sample1.mp4"
        },
        "9f49077a912f958530060272d6d60d30" : {
            "title" : "Sam Smith, Normani - Dancing With A Stranger",
            "subtitle" : "Official video (Ft. Normani)",
            "url" : "https:\/\/my.domain.com\/media\/sample3.mp4"
        }
    }
}

In an effort to comply with apple policy about background task :

As soon as you finish processing the notification, you must call the block in the handler parameter or your app will be terminated. Your app has up to 30 seconds of wall-clock time to process the notification and call the specified completion handler block. In practice, you should call the handler block as soon as you are done processing the notification. The system tracks the elapsed time, power usage, and data costs for your app’s background downloads. Apps that use significant amounts of power when processing remote notifications may not always be woken up early to process future notifications.

videos that weight more than 20 Mb will be discarded. If you note the app its taking too long firing the local notification. remove from the josn payload any file beyond mentioned limit and report the bug. :-)

Once al task have been downloaded. the app send a local notification informing the user about new content.


The project include a library to test remote notifications on simulator . See more details how to send the payload here

vodapp's People

Contributors

bolekhub avatar

Watchers

James Cloos 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.