var push = (function(){ var appId var clientKey var push = {} push.init = function(){ parsePlugin.initialize(appId, clientKey, push.subscribe, push.error) } push.subscribe = function() { parsePlugin.subscribe('SampleChannel', push.did_subscribe, push.error) } push.did_subscribe = function(){ // parsePlugin.getInstallationId(function(id) { // var install_data = { // installation_id: id, // channels: ['SampleChannel'] // } // }, push.error) } push.error = function(e){ console.log("push error") } return push })()