Idea Melt

Focus Mode

Apps

The Notifier

Introduction

The Notifier app makes it really easy to show notifications for any user. The app relies on Backplane to detect the current logged in user. It will automatically render when there is a logged in user present. Similarly, the app will not render if there is no logged in user or will destroy itself when the user logs out.

Dependency

Since the Notifier is built on Echo's SDK 3.0, the only dependency is loader.js

<script src="http://cdn.echoenabled.com/sdk/v3/loader.js"></script>
Initialization

To initialize the Notifier, simply run the code below, entering your keys where needed. You will find these in the Dashboard

Echo.Loader.initApplication({
    "script": 'http://ideamelt.com/static/apps/3.0/im.notifier.js',
    "component": 'IdeaMelt.Apps.Notifier',
    "config": {
        "target": // any valid jQuery selector,
        "appkey": // your Echo appkey,
        "imAppkey": // your IdeaMelt API key,
        "baseDomain": // your base domain as shown in the Dashboard,
    }
});
Methods

To use some of the built in methods in the Notifier, you have to save the app as an object in window. The best way to do so is to include a ready parameter in the config object like so

"config": {
    ...
    "ready": function() {
        foo = this;
    },
    ...
}

All the methods will then be available inside the foo object. The most commonly used methods are

refresh(); Refreshes the Notifier
config.get('KEY') Gets the config value for the specified key
config.set('KEY', 'NEW VALUE') Sets the value for the specified key with the specified value.
NOTE: Make sure you run foo.refresh() after you have changed config settings