What I want to do
I want to subscribe to push notifications notifying me when I make changes to items in Podio.
What I have done to achieve this
I am using the Podio JS library and have read the documentation and gone through the detailed example. I have in accordance with the instructions:
- successfully authenticated with the PODIO api; and
- successfully made a
podio.request
call (receivingresponseBody
withpush
property)
The next step in my code is as follows:
var subscribe = getItem.then (function (responseBody){
return podio.push(responseBody.push).subscribe(callback);
});
var notification = subscribe.then (function () { // never gets here!
console.log ('subscribed');
});
What is not working
The code never gets to the notification
part and consequently does not execute console.log ('subscribed')
. The callback I pass to podio.push(responseBody.push).subscribe(callback)
never gets invoked even though I make changes to the relevant item in my Podio account.
When I run console.log(subscribe)
at an interval of 1000 ms the output is and stays:
lib$es6$promise$promise$$Promise {
_id: 2,
_state: undefined,
_result: undefined,
_subscribers:
[ lib$es6$promise$promise$$Promise {
_id: 3,
_state: undefined,
_result: undefined,
_subscribers: [] },
[Function],
undefined ],
_onerror: null }
What my question is
I would very much appreciate help identifying why the push service is not working even though I - as I see it - as done exactly as instructed by the documentation.
Thank you in advance!