我想要做什麼波迪奧JS:不能成功訂閱推送服務
我想訂閱推送通知,通知我,當我修改的波迪奧項目。
我做了什麼來實現我使用波迪奧JS庫,並閱讀documentation,並通過the detailed example了這個
。我已按照說明:
- 已成功通過PODIO api驗證;和
- 成功做出了
podio.request
呼叫(接收responseBody
與push
屬性)
在我的代碼中的下一個步驟如下:
var subscribe = getItem.then (function (responseBody){
return podio.push(responseBody.push).subscribe(callback);
});
var notification = subscribe.then (function() { // never gets here!
console.log ('subscribed');
});
什麼是不工作
的代碼永遠不會到達notification
部分,因此不會執行console.log ('subscribed')
。即使我更改了我的跑道帳戶中的相關項目,我傳遞給podio.push(responseBody.push).subscribe(callback)
的回叫也不會被調用。
當我在1000毫秒的間隔運行console.log(subscribe)
輸出和保持:
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 }
我的問題是什麼
我將非常感謝幫助確定爲什麼Push服務不即使我 - 正如我所看到的 - 完全按照文檔的指示完成工作。
預先感謝您!
作爲實驗,你可以嘗試和測試,如果改變是否是由其他人完成它的工作。我指的是這部分,即使我對我的跑道帳戶中的相關項目進行了更改。你可以讓其他人做出這些改變(或從不同的賬戶做)嗎? –
@Pavlo:我現在已經試過了,它不會改變任何東西。結果是一樣的。我想知道我是否應該將[Faye](https://faye.jcoglan.com)連接到服務器。但關於Podio JS的指示在這方面沒有提及任何事情....? – rabbitco