GithubHelp home page GithubHelp logo

isabella232 / session-push-notification-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oxen-io/session-push-notification-server

0.0 0.0 0.0 322 KB

Server which collects APNS tokens and sends oblivious notifications to iOS devices

Jsonnet 1.48% Python 98.52%

session-push-notification-server's Introduction

Session Push Notification Server

This is a python script for Session remote notification service

API Documentation

Use Python 3.7

To run the server:

Use pip install -r requirements.txt to install all the requirements first.

To start the server, use python server.py

The server is built with Flask and tornado.
The server uses APN for iOS push notifications, PyAPNs2 to interact with APNs, and FCM for Android push notifications.

Right now the server only receives onion requests through the endpoint /loki/v2/lsrpc for

  • register: register a device token associated with a session id
  • unregister: unregister a device token from a session id's devices
  • subscribe_closed_group: add a session id to a closed group as a member
  • unsubscribe_closed_group remove a session id from a closed group members
  • notify: send a message from remote notification

The new push notification server works this way:

  • The client (Session Desktop or Mobile app) sends encrypted message data with the recipients' session id to server.
  • The server checks the database to see if the recipients has registered their devices.
  • The server generates and sends the push notification to the devices registered with their tokens.

The server will store some statistics data every 12 hours for analysing the traffic going through. The data includes:

  • The number of messages sent to the server
  • The number of messages sent to closed groups
  • The number of push notifications sent to iOS devices
  • The number of push notifications sent to Android devices

There is also an endpoint /get_statistics_data to get the data above.

session-push-notification-server's People

Contributors

nielsandriesse avatar ryanrory 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.