Deleting object from parse-server code causing error?
The findObjectsInBackground method doesn't return results of type PFObject, but [PFObject], which is an array of PFObjects... If you want to delete the whole array, you can use the class method deleteAllInBackground like so:
PFObject.deleteAllInBackground(objectt, block: nil)
Or you can iterate through the array:
for objectt in object! {
objectt.deleteInBackground()
}
Unable to update [PFUser currentUser] when Public Updated Disabled
I ended up getting the following answer from Hector Ramos on the Parse Google Group ( https://groups.google.com/d/msg/parse-developers/JFMrXheHgdo/1dw_6dl1EmUJ )
In order to link a user to Facebook, the user object must be modified.
You'll need to turn on Updates for this class. Per-object ACLs cannot
increase the scope of permissions past what the class-level ACLs are
providing, as far as I know.
I took this to mean that I had to enable Updates for the class in order for any update to be made at all.
I still was a little concerns this could some how allow unauthorized updates to my user account (as this answer wasn't 100% clear). To be on the safe side, I also added a CloudCode before save hook which sets the users Access Control List (ACL) to only allow them access to this object (as per my apps requirements).
Parse.Cloud.beforeSave(Parse.User, function(request, response) {
// Set ACL for new User to only that user
request.object.setACL(new Parse.ACL(Parse.User.current()));
response.success();
});
PFQuery current user specific objects
You want to output the name
values for where owner
is the current user, if I understand you correctly:
[query whereKey:@"owner" equalTo:[PFUser currentUser]];
When comparing to a pointer, you compare the full object. The Parse SDK under the covers converts that to correctly comparing objectId values and object types, you don't need to worry about it.
Cannot Update Data on Parse
Remove ACL code to create ACL value on parse. This will restrict to edit Data from Android to iOs or vice versa..
How do I associate a Parse user with their respective installationId when they log in/sign up?
Because I don't know why you want to do it, I can't say what method to use is best, but I actually create a custom property of the Installation class called userId, and associate the two that way. That code looks like the following:
PFInstallation *currentInstallation = [PFInstallation currentInstallation];
[currentInstallation setObject:[PFUser currentUser].objectId forKey:@"userId"];
[currentInstallation saveInBackground];
That works for push notifications if that's your goal. If you really are set on that installationId property being part of the user class, then you could just do what I did, then query the Installation class for matching userIds, although that's bit circuitous.
Related Topics
Swift Coredata: Unable to Section Tableview Using Sectionnamekeypath with Custom Function
Swift Guard Else Called on Dictionary Key with Null Value
Generate Random Questions in Swift
Swift: Right/Left Click on Nsstatusbar
Gmsmarker Not Appearing on Map
Post Urlrequest Doesn't Work in Swift 4
Playing Multiple Wav Out Multiple Channels Avaudioengine
Double Variable in Mkmapitem Array
Encode Struct and Convert to Dictionary [String: Any]
Advantage of Computed Properties (Gettable Ones Only) VS. Stored Properties
How to Put a View with Loadmore Button in UItableview After The Cell
How to Use a Protocol with a Typealias as a Func Parameter
Navigation Bar Title View Missing in iOS11
Trying to Display Location Data from Firebase to Mapkit
Why I Can't Convert String to Date in Swift