pfrelation

Parse to Heroku migration (MongoLab): PFRelation issue

烈酒焚心 提交于 2019-12-13 05:33:23
问题 I succeeded to migrate parse to parse-server with mongolab. Now everything works as expected, except when I'm logging with PFUser with MongoLab, my PFRelation object is always null. In my AppDelegate, when I run this code (official Parse): [Parse setApplicationId:@"xxxxxx" clientKey:@"xxxxxx"]; [PFUser enableRevocableSessionInBackground]; HomeView.m: self.currentUser = [PFUser currentUser]; self.friendsRelation = [[PFUser currentUser] objectForKey:@"friends"]; NSLog(@"%@", self.currentUser);

How to get the PFRelation objects while getting the PFquery objects?

ε祈祈猫儿з 提交于 2019-12-11 19:22:21
问题 NSPredicate *predicate=[NSPredicate predicateWithFormat:@"(UserId==%@)",[defaluts objectForKey:@"objectId"]]; PFQuery *frndquery=[PFQuery queryWithClassName:@"FriendsDetails" predicate:predicate]; [frndquery orderByDescending:@"lastdate"]; [frndquery whereKey:@"BlockStatus" equalTo:@"No"]; NSArray *arrquery=[frndquery findObjects]; for (PFObject *frndids in arr){ PFRelation *relation=[frndids relationforKey:@"ChatRelation"]; NSArray *arrids=[NSArray arrayWithObjects:[frndids objectForKey:@

save current user to relation in parse with swift

吃可爱长大的小学妹 提交于 2019-12-11 11:01:49
问题 I have a system where when the current user accepts a request my app adds a relation between the user that sent the request to the current user. However I want to also have the current user added to the other user's relation so that it is not just the current user that has a relation. My code for the current user works, but not for the other user. //i use this pattern to add the requester to a friends relation to the current user var relation = PFUser.currentUser()!.relationForKey("Friends")

iOS - Parse.com PFRelation for adding friends only adds the relationship for current user, not for the friend being added

陌路散爱 提交于 2019-12-08 13:20:26
问题 My app has a view controller where the user can add friends. The app accesses the user's address book, and calls to the Parse.com backend server to see if any of the address book contacts are already using the app. If any are found, then I place the PFObjects for those users in the rows of my UITableView. Each row in the table has a button. If the user presses a row's button, then the following code is executed which creates a PFRelation object called friendsRelation and adds the PFObject of

Why PFRelation does not support fromLocalDataStore queries?

这一生的挚爱 提交于 2019-11-30 14:18:02
问题 I have a PFUser object with several PFRelation pointing to other objects. When I run the following code: PFRelation *relation = [[PFUser currentUser] relationForKey:@"Relation"]; PFQuery *query = [relation query]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error){ NSLog(@"%@", objects); }]; it works fine. However, when I want to do the same from the local data store: PFRelation *relation = [[PFUser currentUser] relationForKey:@"Relation"]; PFQuery *query = [[relation

Why PFRelation does not support fromLocalDataStore queries?

放肆的年华 提交于 2019-11-30 10:08:49
I have a PFUser object with several PFRelation pointing to other objects. When I run the following code: PFRelation *relation = [[PFUser currentUser] relationForKey:@"Relation"]; PFQuery *query = [relation query]; [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error){ NSLog(@"%@", objects); }]; it works fine. However, when I want to do the same from the local data store: PFRelation *relation = [[PFUser currentUser] relationForKey:@"Relation"]; PFQuery *query = [[relation query] fromLocalDataStore]; // !!! [query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError

Adding a user to PFRelation using Parse Cloud Code

有些话、适合烂在心里 提交于 2019-11-29 12:28:20
I am using Parse.com with my iPhone app. I ran into a problem earlier where I was trying to add the currently logged in user to another user's PFRelation key/column called "friendsRelation" which is basically the friends list. The only problem, is that you are not allowed to save changes to any other users besides the one that is currently logged in. I then learned, that there is a workaround you can use, using the "master key" with Parse Cloud Code. I ended up adding the code here to my Parse Cloud Code: https://stackoverflow.com/a/18651564/3344977 This works great and I can successfully test

Parse: How do I query using PFRelation when I just have PFUser?

空扰寡人 提交于 2019-11-28 10:21:28
问题 Here is an example of what I am trying to do. I have the current user as PFUser and on another class named Item I have a relation named "owners" which is a relation of PFUser. I want to query for all instances of Item which have the current user in the relation. I see examples of the opposite way of querying, but I do not see how to get a relation and then filter it to a PFUser match on the relation. Here is one example. https://www.parse.com/questions/inverse-relationship-support PFObject

Adding a user to PFRelation using Parse Cloud Code

a 夏天 提交于 2019-11-28 06:30:35
问题 I am using Parse.com with my iPhone app. I ran into a problem earlier where I was trying to add the currently logged in user to another user's PFRelation key/column called "friendsRelation" which is basically the friends list. The only problem, is that you are not allowed to save changes to any other users besides the one that is currently logged in. I then learned, that there is a workaround you can use, using the "master key" with Parse Cloud Code. I ended up adding the code here to my