0
我是strongloop的新手,我實現了android的推送通知。在Strongloop發送推送通知時,設備被從安裝中刪除
一切工作正常,然後設備開始從數據庫中的安裝集合中消失,同時發送通知。我不知道爲什麼會發生這種情況,請幫我解決這個問題。
這可能發生的所有情景是什麼?用於發送通知
我pushService代碼:
exports.sendPush = function (appObject,deviceId,type,userId,incomingMessage) {
var PushModel = appObject.models.push;
var androidNotification = appObject.models.notification;
// to avoid event emitter memory leak
pushModel.removeAllListeners('error');
var note = new androidNotification({
message: incomingMessage,
deviceId: deviceId,
type: type
});
pushModel.notifyByQuery({userId: userId,deviceType:"android"}, note, function(err) {
if(err)
{
console.log('android : pushing notification failed to %j', userId);
}
else
{
console.log('android : pushing notification to %j', userId);
console.log('android note : ',note);
}
});
pushModel.on('error', function (err) {
console.error('Push Notification error: ', err.stack);
});
};
我有同樣的問題。 – mnesarco
@mnesarco上的任何解決方案? –
我很抱歉@ ilir-aga我不再使用StrongLoop。 – mnesarco