Git Product home page Git Product logo

firebase_cloud_messaging's Introduction

Firebase Cloud Messaging With XMPP Servers

What is it about?

Erlang Implementation Of Firebase Cloud Messaging Through XMPP Servers

Links

Setting Up

  • Install Erlang (Please Search Google)
  • Clone Repo
  • Execute Command make At Root Folder Location. This Will Download Required Dependencies And Compile Them.
  • To Run In A Console, Execute _rel/firebase_cloud_messaging_release/bin/firebase_cloud_messaging_release console
  • Execute Command q(). To Quit For Now.
  • You'll Have A Settings File Named : settings.txt. It Contains All The Settings You Can Configure To Establish Firebase XMPP Connections And Set Different Limits As Required.
  • To Establish Firebase Connections, fcm_sender_id & fcm_server_key Are Required. These You Can Find In Your Firebase Project's Cloud Messaging Section
  • If The fcm_connection_limit Is Set To 0 In settings.txt You May Initialize A New FCM Connection With Following Command: fcm_manager:create_fcm_process().
  • Set Log Levels verbose/info/debug/error To Control Logs In settings.txt
  • After Setting Up Parameters, Execute Console Command To Run And Create FCM Connections
  • To Communicate with external application, establish a unix domain socket over TCP. The default uds location is /tmp/fcm.socket

Features And Support

  • Supports Only Android For Now (No Support For iOS)
  • Sends Only data Notifications With Priority (high/normal) Having TTL 0 To Improve Latency
  • Sends Bundle Of Messages To Optimize Bandwidth
  • Does Not Support Delivery Receipt
  • Automatic Retry Of nack Messages
  • Configurable Paramters To Control Throughput And Message Rate Per Device
  • Handles Connections With State idle Or service unavailable
  • Communicate with external application over tcp socket

Setting Parameters

  • listen_on : either listen on unix_socket or http_port.
  • unxi_socket : unix_socket location, defaults to "/tmp/fcm.socket"
  • http_port : which port to listen on , defaults to 3000
  • fcm_process_pool_upper_bound : Maxmium number of messages in the pool of fcm_process before it stops accepting further message.
  • fcm_process_pool_lower_bound : Minumum number of messages in the pool of fcm_prcess before it starts accepting new messages again.
  • default_timeout_idle_timeout_milli_seconds : Timeout process polls for new message to process. If there are none, it remains idel for these milli seconds.
  • fcm_connection_service_idle_timeout_seconds : If fcm_process is idle for timeout_seconds, it will be disconnected.
  • fcm_connection_service_unavailable_timeout_seconds : If fcm_process remains unavailable to process any message, it will disconnected after timeout_seconds.
  • fcm_general_message_delay_per_device_nano_seconds : You may even set a delay after consecutive message to be sent to a particular device.
  • fcm_connection_monitor_interval_seconds : After how long monitor process should check fcm_process state and handle accordingly.
  • fcm_connection_limit : Maximum number of fcm_process to established when required.
  • fcm_sent_message_acking_wait_seconds : wait time for a particular message to be acknowledged before it is discarded.

Json Message Format Over TCP

The tcp socket sends out following messages to the other end:

  • {type:upstream_data, fcm_id:FcmId, data:JsonDataFromTheDevice}
  • {type:fcm_id_updated, fcm_id:FcmId, old_fcm_id:OldFcmId}
  • {type:fcm_id_deregistered, fcm_id:FcmId}

And accepts message in following format:

  • {fcm_id:FcmId, data:JsonDataToTheDevice}

firebase_cloud_messaging's People

Stargazers

 avatar

Watchers

 avatar

Forkers

aginfo2

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.