I am kind of new to programming and parse, but I am really interested in it. I already know how to create a PFUser and how to set relations between Users, thanks to the tutorial provided on parse.com. The thing is they only have examples for one User following another User. I would prefer sending like a "Friends Request", for example like in instagram if a profile is not open to anybody. How can I code that? What do I need to think of? Example Code is very welcome :P
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
- Is there a Github markdown language identifier for
It's relatively simple.
For register or signin, call the PFUser's class method:
If you want user a follow user b, you can create a follow class which would be more efficient in the future.
I would definitely create a FriendRequest table as @MatthewLuiHK suggested. However, I don't know if this is the best way to track who is following who, this would just allow for tracking open friend requests. In my apps I use a cloud code function to set a
friends
array in each user's object, as you cannot modify other users without the master key. Below is the function I use:Before calling this function, you need to add the
fromUser
pointer to the array in the current usersfriends
column, then send in the fromUserobjectId
into this function under the "fromUserId" key in the dictionary.