Giter Site home page Giter Site logo

timwm / electron-uwp-background Goto Github PK

View Code? Open in Web Editor NEW

This project forked from felixrieseberg/electron-uwp-background

0.0 0.0 0.0 46 KB

:zap: Sample explaining how to use UWP background tasks with Electron apps

License: MIT License

JavaScript 36.00% C# 58.90% HTML 5.10%

electron-uwp-background's Introduction

Electron & UWP Background Task

This repository contains sample code showing how to use background tasks from Electron apps. A background task can be used to interact with the user's operating system when the application is not running - for instance to display toast notifications or to update live tiles.

Two components are required:

  • Electron app
  • Background task that can be invoked by Windows

The background task needs to be registered at runtime, usually during the first launch of your application. For the sake of simplicity, this example uses a little invisible .NET console app invoked by the Electron app at launch, but you're at liberty to perform the registration of the background task with any means you see fit.

Prerequisites

Running the Example

  • Download the example (which has binaries included) and unzip it.
  • Open up PowerShell as an administrator and execute Add-AppxPackage –register ./electron-uwp-background/AppxManifest.xml
  • In your start menu, search for "Electron Background". Make a right click and pin it to your start menu. Run the app.
  • In your settings, change your time zone. A notification should pop up, and the tile of your app should update.

⚠️ Do not be shocked if the notification or the new live do not show up immediately. They should be visible within the first two minutes, but dependening on your system and its load, it might take longer.

Building from Source

  • Run npm install to install all Node dependencies
  • Use Visual Studio to open and build the background task (background-task/BackgroundTask.csproj)
  • Use Visual Studio to open and build the background task registerer (background-task-registerer/BackgroundTaskRegisterer.csproj)
  • Run npm run build to build a folder with the contents of the AppX package
  • You can "install" the folder by running Add-AppxPackage –register ./output/AppxManifest.xml

License

MIT; Copyright (c) 2016 Microsoft Corporation & Felix Rieseberg. See LICENSE.md for details.

electron-uwp-background's People

Contributors

felixrieseberg 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.