我有一個iOS和Android應用程序,部署在Parse Server中。現在,我想從雲端功能中使用LiveQuery SDK!在Cloud代碼中解析LiveQuery
這裏是我的雲代碼:
Parse.Cloud.define("subscribeQueryFunction", function(request, response) {
var query = new Parse.Query("Message");
var subscription = query.subscribe();
subscription.on("create", (object) => {
response.success(object);
});
});
我的銀行代碼:
的事情是,客戶端沒有得到迴應!雖然,我查了日誌和訂閱似乎成立:
2017-05-14T16:49:12.442Z - Ran cloud function subscribeQueryFunction for user D7FP3cts5p with: Input: {} Result: {"text":"hey","createdAt":"2017-05-14T16:49:12.412Z","updatedAt":"2017-05-14T16:49:12.412Z","objectId":"DXCiumOTal","__type":"Object","className":"Message"} 2017-05-14T16:49:11.101Z - Ran cloud function subscribeQueryFunction for user D7FP3cts5p with: Input: {} Result: {"text":"hey","createdAt":"2017-05-14T16:49:11.044Z","updatedAt":"2017-05-14T16:49:11.044Z","objectId":"qkXS6csCKJ","__type":"Object","className":"Message"} 2017-05-14T16:49:09.099Z - Ran cloud function subscribeQueryFunction for user D7FP3cts5p with: Input: {} Result: {"text":"hey","createdAt":"2017-05-14T16:49:09.080Z","updatedAt":"2017-05-14T16:49:09.080Z","objectId":"ydnrDHO9AP","__type":"Object","className":"Message"} 2017-05-14T16:47:45.183Z - Create new client: 0
任何想法?
? –
@JulienKode因爲我想爲iOS和Android編寫一次代碼,並且沒有開發人員對它進行單獨編碼 –
哦,我明白了,但我不認爲Live Query是用於服務器端的。這適用於網絡套接字 –