Adding blocking users to a list - ios

Example: Twitter user A is blocked from Twitter user B.
If I use lists/members/create, it won't let me add user B to a list user A created. Correct.
If I use lists/members/create_all with user B in the list of users , it will let me add user B to a list created by user A. WRONG.
Is it supposed to be like that or is it a bug?

It's one of the many bugs with Tiwtter's list endpoints. (You still shouldn't get their Tweets when you get the list feed.)

Related

iOS: Firebase realtime database sub child querying

I work on iOS app that use firebase real time database, my structure as , I want to write a query that retrieve all users of a group, each user have multiple groups, and each groups have multiple users, I capable of showing all groups of one user and I want to show all other users they are belong to that group, i.e, when user choose of his groups,
How can achieve that?
In my opinion, the best way to deal with this is to duplicate your data. If you definitely need the structure you posted above, you can keep it and create also another one as such:
"groupUsers": {
"123" : { //groupId
"235" : { //uniqueKey for record
userId: "567",
userName: "Jack"
}
}
}
To get all users in a certain group use the firebase reference:
`/groupUsers/${groupId}/`
You loop over the returned list to show values from each list item.

updating many users at once in parse

I'd like to update user's column which presents related posts that the user might like,
my code is like that:
let users = query.findObjects() as [PFUser]
for user in users{
let rel = user.relationForKey("posts")
rel.addObject(post, forKey: "relatedPosts")
rel.saveInBackground()
}
I really don't know why, but I tried to do that in many versions (not only by relation, also by arrays and other methods) and it always updates just one user (the one who logged in)..
how can I get this done?
You can't update user that is not currently authenticated in your app.
The way I see it you have 2 options:
1) You can set some Cloud Code to run using the master key, so it can modify users.
2) You can add a new custom column to your Parse User class that will link to another class DB that has the related posts for the user.
take a look here: Parse.com Relations Guide
I would choose #2.

Pictures and videos in a tableview for each user

My app will have a tableview with a picture and a title on each row, when the user taps it, it will open another view with that title, some texts and some pictures.
Now, I want each user to have different items in the tableview. For making it easier, suppose it is going to be a todo list like this:
Wash the car (Picture1) (video1) (InstructionsText)
Go to the groceries store (Pic2) (Vid2) (instrText2)
Pay the Bills (Pic3) (Vid3) (instrText3).
Now, I want to assign these items differently for each user, and show in a tableview.
USER 1 TABLE VIEW
Wash the car (Picture1) (video1) (InstructionsText)
Pay the Bills (Pic3) (Vid3) (instrText3).
USER 2 TABLE VIEW
Pay the Bills (Pic3) (Vid3) (instrText3).
USER 3 TABLE VIEW
Wash the car (Picture1) (video1) (InstructionsText)
Go to the groceries store (Pic2) (Vid2) (instrText2)
...
Now, here's my idea: each of these tasks should open a view controller with pictures, videos and text related to them. Using Core Data, I could create a modal, a entity called TodoList and attributes like title, text. First question: Can I create attributes for videos and pictures as well and store them here?
Suppose I have 500 different tasks, I will have to create a view controller for each, right? How would I relate these tasks to each user, like the example above? So each user would have his own tableview with the tasks leading to view controllers.
Assuming it is possible to make this work, how could I change the tasks assigned to each user directly, without having to use xcode or doing it programatically?
Use Core Data to store all your required fields in which image and video can also reside in Core Data. Use predicate to fetch the data according to constraints imposed on each user. When he will open the app, app should be able to fetch data according to user condition. After this you can load your table.
Hope this helps.
If we consider TO-DO apps , if a user should be able to see his own content , he will have to enter his own content through the app.This data is then stored in some backend either Core Data , SqLite or even cloud backend like Parse.com.Then the user is able to fetch his data , and see the contents in any view ...like tableView in your case.

How to get the 'id' for accessing user details in instagram

How do i get the id for accessing user info by (Hashie::Mash)user(id) method of the instagram API or accessing his/her location by (Hashie::Mash)location(id)?
I am using rails for my project.
You can search for a user to get his/her id, e.g:
shaynesids = Instagram.user_search("Shayne Sweeney")
That will give you all the ids on an array of user matching Shayne Sweeny (hopefully just one), then you can use it with user(id), like this:
myuser = Instagram.user(shaynesids.first)
Note: In here I'm assuming that the search it's gonna return at least one result, you will need to be careful in your code to account for errors, because it could return an empty array.

Google Contacts: Unique Contacts?

I am building an application that I will need to distinguish the Google Contacts from each other. I am just wondering, as long as google sends contacts as First Name/Last Name/mail.. etc (Example) without a unique ID, what will be the first approach to distinguish each contacts?
1) Should I create an ID based on the user's fields? -> by a minimal change, it can break down.
2) Should I create an ID based on First Name + Last Name? -> but most people can have duplicate contacts on their page, would that be a problem? Or married contacts, which can create a little mess.
The reason I am asking this I am trying to create relations and I need to store the data somewhere like that [person=Darth Vader, subject=Luke Skywalker, type=father(or son)], so I need a fast algorithm that can make a mapping for each contact and retrieve the related contacts fast.
I believe they do send back an ID. From the return schema:
<link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/contacts/userEmail/full/contactId'/>
You could use the full HREF value as the ID, or parse out the contactID from the end of the URL, whichever you like better.

Resources