Simple way to add presence to your app using firebase.
bower install presence-fire --save
An element that saves the presence of the user at a route and gets all other users at that route.
<link rel="import" href="/bower_components/presence-fire/presence-fire.html">
<!--What you need:-->
<firebase-app
name="presencefire"
api-key="AIzaSyAhoCXxkY-ffNwA_7L7HIwBVpASYj1btNE"
auth-domain="convoo-login-demo.firebaseapp.com"
database-url="https://convoo-login-demo.firebaseio.com">
</firebase-app>
<presence-fire
app-name="presencefire"
uid="[[user.uid]]"
photo="[[user.photoURL]]"
name="[[user.displayName]]"
route="{{route}}"
status="{{status}}"
present="{{present}}"
private="{{private}}">
</presence-fire>
<!--Just for the demo:-->
<social-login-fire
twitter
app-name="presencefire"
user="{{user}}">
</social-login-fire>
<div>
Currently here:<br><br>
<div class="photoContainer">
<template is="dom-repeat" items="{{present}}">
<img src$="{{item.photo}}" alt="{{item.name}}" class="photo">
</template>
</div>
</div>
<paper-input id="route" label="Route" value="{{route}}" readonly></paper-input>
<br>
<paper-button raised onclick="_changeRoute('a')">Route A</paper-button>
<paper-button raised onclick="_changeRoute('b')">Route B</paper-button>
<paper-button raised onclick="_changeRoute('c')">Route C</paper-button>
<br><br>
<paper-toggle-button checked="{{private}}">Private Browsing</paper-toggle-button>
First, make sure you have the Polymer CLI installed. Then run polymer serve
to serve your application locally.
$ polymer serve
$ polymer build
This will create a build/
folder with bundled/
and unbundled/
sub-folders
containing a bundled (Vulcanized) and unbundled builds, both run through HTML,
CSS, and JS optimizers.
You can serve the built versions by giving polymer serve
a folder to serve
from:
$ polymer serve build/bundled
$ polymer test
Your application is already set up to be tested via web-component-tester. Run polymer test
to run your application's test suite locally.