is there any way to save the Models which extends Push (Push as base) . Like I want to save the push model into database after I have sent a push notification.
thanks.
is there any way to save the Models which extends Push (Push as base) . Like I want to save the push model into database after I have sent a push notification.
thanks.
have you looked at http://docs.strongloop.com/display/LB/Push+notifications#Pushnotifications-Createapushmodel? Can you describe your scenario a bit more?
If I understood the question right, you need to save the notification message itself. Seems like it is not a Push model instance you may be interested in, but Notification. Here is what documentation says (same link as provided by @superkhau):
Notification - model to capture notification messages and persist scheduled notifications.
It means that if you are not scheduling notifications (which is not available yet anyway), but sending them via PushManager.notifyByQuery or PushManager.notifyById, the Notification will not be persisted. So what I would try to do is put this logic into a custom method and do two operations, e.g.:
Notification.create(notificationData, function(err, createdNotification) {
PushManager.notifyById(someId, createdNotification, ...)
...
}
What I'm really not sure yet about is what is the plan of doing scheduling of notifications and whether such approach will conflict with it somehow.