Users Class
Static methods for the Users model
Item Index
Methods
Methods
listen
-
[options={}]
Start internal listener for Users plugin and open socket
Accepts "Users/session" message
listen
-
options={}
Fetches a user from the database
Parameters:
-
options={}
ObjectSo far no options are implemented.
userFromSession
-
sessionId
-
callback
Gets a user (from database if needed) associated with sessionId and passes it to callback.
pushNotifications
-
userIds
-
notifications
-
[callback]
-
[options]
-
[filter]
Pushes notifications to all devices of the given user or users
Parameters:
-
userIds
String | ArrayA user id, or an array of them, in which case notifications would be an object of { userId: notification }
-
notifications
ObjectIf userIds is an array, this is a hash of {userId: notification} objects, otherwise it is just a single notification object. Please see Users.Device.prototype.pushNotification for the schema of this object.
-
[callback]
Function optionalA function to call after the push has been completed
-
[options]
Function optionalAny additional options to pass to device.pushNotification method
-
[filter]
Function optionalReceives the Users.Device object. Return false to skip the device.