Skip to content

Instantly share code, notes, and snippets.

@mosssdesign
Created September 19, 2015 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mosssdesign/55918ac6219123cd2a95 to your computer and use it in GitHub Desktop.
Save mosssdesign/55918ac6219123cd2a95 to your computer and use it in GitHub Desktop.
CheckUploadFrequency
self.checkUploadFrequency({ (objects, success) -> () in
guard success == true else {
return
}
guard let objCount = objects?.count
where objCount > 3 else {
return
}
self.getAdminUsers({ (adminUser, success) -> () in
let usersReceivingNotification = adminUser
for user in usersReceivingNotification {
let senderUser = PFUser.currentUser()
let senderName = senderUser["username"] as! String
self.parse.sendPushNotificationToUser(user.objectId, message: "\(senderName) uploaded \(objCount) photos", type: "userUploadPhotos")
print("pushIsSent", terminator: "")
}
})
})
self.close({()})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment