title: Titanium Alloy Push Notifications - passing function as callback to be called inside event listener
body: <p>I have set up a module for dealing with Push-Notifications which has this:</p>
  
  <pre><code>//myPush module
  var CloudPush = require('ti.cloudpush'); 
  ...
          var setAppPushNotifications = function(cback) {
              // Process incoming push notifications
              log('cback=' + typeof cback);  //log is a wrapper to Ti.API.info
              CloudPush.addEventListener('callback', function (evt,cback) {
                  log('Inside CloudPush-Callback.');
                  log('cback=' + typeof cback); 
                  getIncomingNotification(evt, cback);
              });
          };
          var getIncomingNotification = function(evt,cback) {
              //return if zero payload 
              //test for app required basic fields
              log('cback=' + typeof cback); 
              cback(evt.payload);
          }; 
  </code></pre>
  
  <p><strong>Scenario</strong>: I use it inside a Controller, so that I can pass a callback that is Controller related (for example, after callback processing I want to close the controller/views and open another one):</p>
  
  <pre><code>//controller code
  var myPush = Alloy.Globals.myPush; 
  ...
      myPush.setAppPushNotifications(processNotificationPayload);
  
      function processNotificationPayload(p) {
          //select notification channel
          //do some processing...
          //close controller and view and get back to index.
      }
  </code></pre>
  
  <p>The problem is: <strong>cback</strong> function is not been passed along, or, by the time of <strong>CloudPush-callback</strong> event is called, <strong>cback</strong> doesn't exists anymore.
  I got the following logs:</p>
  
  <pre><code>[myPush.js][setAppPushNotifications]: cback=function
  [myPush.js][setAppPushNotifications]: cback=undefined
  [myPush.js][getIncomingNotification]: cback=undefined
  </code></pre>
  
  <p><strong>What would be a solution respecting the given scenario</strong> ? 
  Please show me some code. 
  Thanks.</p>