22 comments found.
I would just like to say that this is a great project for anyone wanting to learn parse, its nice and clean and easy to edit
That being said I am having one problem that I hope you can help me with
The code below looks like it should work but sadly it does not
Can you let me know what I’m doing wrong?
What I’m trying to do is show a user all the rooms another user has set up, this code should look at the class “Rooms” then look at the “userPointer” and return all the rooms that equal that userPointer
Any advice is very much appreciated
let query = PFQuery(className: "Rooms")
query.whereKey("userPointer", equalTo: "GqaHUrlpHg")
The userPointer is a PFUser() object like:
var userObj = PFUser()
equalTo: "GqaHUrlpHg")
If I can get it to work manually It would be easy to set it up as a variable
I would need to see your code and database, sorry, i can’t help you with such poor info, because the Rooms class already has a userPointer column, so where have you added such userPointer? You cannot get a user pointer with a String like “GqaHUrlpHg”, that’s a String, while a userPointer it’s an instance of PFUser(), you keep getting confused between a user objectID (a String) and a user pointer (PFUser() type).
We’re sorry but we don’t have so much available time to deal with this customization, so please contact us by our profile’s contact form and explain us in details what your app should do, where you want to show user’s Rooms, besides the Home screen that already does that, maybe send us a mockup which will help us understand how your app should work, and we may guide you through it in a short time and the both of us will save time and effort on this issue Thanks!
A slight bug in the code allows people to create rooms with no titles. This is actually very annoying and makes the user interface look bad, as there should be a dialog that pops up on the users end, and asks them to enter a title for the room. Please Fix!!!
I’ll add an if statement to it asap
Easy fix, just replace the createRoomButt()
in NewRoom.swift with this code:
// CREATE ROOM BUTTON -> SAVE IT TO PARSE DATABASE @IBAction func createRoomButt(_ sender: AnyObject) { if nameTxt.text != "" { showHUD() let roomsClass = PFObject(className: ROOMS_CLASS_NAME) let currentUser = PFUser.current() // Save PFUser as a Pointer roomsClass[ROOMS_USER_POINTER] = currentUser // Save data roomsClass[ROOMS_NAME] = nameTxt.text!.uppercased() // Save Image (if exists) if roomImage.image != nil { let imageData = UIImageJPEGRepresentation(roomImage.image!, 0.8) let imageFile = PFFile(name:"image.jpg", data:imageData!) roomsClass[ROOMS_IMAGE] = imageFile } // Saving block roomsClass.saveInBackground { (success, error) -> Void in if error == nil { self.simpleAlert("Your new room has been created!") self.hideHUD() self.dismiss(animated: true, completion: nil) } else { self.simpleAlert("\(error!.localizedDescription)") self.hideHUD() }} // You must type a title } else { simpleAlert("You must type a title to your Room!") } }
thanks, I’m going to try it. Can you update this in the next release?
already submitted an update, haven’t you got an email from Envato? download the updated version on your Downloads page
Yea I just downloaded it….Having a problem with the updated version let REFRESH_TIME: TimeInterval = 30.0 in configs. Expected expression after operator error
Wait…..my error….I added a / to the file by mistake
ok
I updated my app with the latest version and push notifications stopped working…any ideas why?
No, without seeing your code or console log messages, it’s hard to identify your issue.
I can send my project, please send email. I just tested out again. I got one text message for the 3 messages I created. The other two times the text message didn’t come up. Do you only get text messages while in the app?
The Push notification you get is when someone send an audio message to your own Room, that’s it. If you got one push notifications though,. it means it works, the other 2 probably have not been sent yet from the back4app server and that may be because they’re doing some maintenance work on the server right now. Check the Paste Pushes console on your Dashboard.
Ok, well then I guess this explains the issue. I thought you would get push notifications for posting in every room. I just tested, and I do get push notifications for my own rooms, but if I post in someone else’s room then I don’t get a notification, which I guess is the intended behavior.
Sure, because notifications are for users who own a room where other users send an audio message, it’s like a chat, you don’t get push notifications for your own sent messages
Ok makes sense….thanks for your help
you’re welcome!