Twitter REST API check for suspension - twitter

When a user's Twitter account is suspended, user can still sign in with his/her Twitter account.
REST API doesn't give any information about the suspension.
If user makes a GET friends/ids, no error code comes. Only empty friends list.
Is there a way to understand a signined user's suspension state ?

Related

Login to facebook api and scheduled events

I have a setup where users are required to log into my ios application using facebook. I want to poll their friend's information every couple hours and notify them on any changes. Is this possible with what is allowed by facebook api? Essentially, if i user facebook ios login to sign the user in, and I receive an access token, could I use that token days or weeks later?
As WizKid commented, you canĀ“t access friends information anymore, friend permissions are deprecated since v2.0, as you can read in the changelog: https://developers.facebook.com/docs/apps/changelog
Information about Access Tokens and how long they are valid can be found here:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/
Also, polling information is a very bad idea, if you want to check for changes (of an authorized user only!), you better user the Realtime API: https://developers.facebook.com/docs/graph-api/real-time-updates/

Twitter prefilled message is allowed or not?

I have just found out that Facebook policy prevents pre-filled messages. What about twitter, I cant find such hard restriction on Twitter policy, is my understanding correct ?
According to Twitter Developer Rules ,
Section II Principles
1. Don't surprise users
B. Get users' permission before:
sending Tweets or other messages on their behalf. A user authenticating through your application does not constitute consent to send a message.

Does a user need to be logged in on Facebook to share an open-graph story through Facebook Messenger?

For a user to be able to message an open-graph story via the new Facebook Messenger functionality (messaging an open graph message), does the user need to be logged in to Facebook in my app?
I am talking about the new functionality presented by Facebook at their f8 conference (sending an open graph story to friends through Facebook Messenger).
I'm pretty sure I have everything set up correctly in my mobile app. But the problem is that the other testers (people registered as testers in my app on Facebook) are receiving the open graph story correctly, but when tapping on the open graph story, even though Facebook Messenger redirects to the right app (my app), the FBAppCall object doesn't contain any targetURL information, there is no &target_url=.... ...even though my open graph object has a proper URL set.
That is why I am thinking: Does the user need to also POST the open-graph the story somewhere (thus the user needs to be logged in with Facebook), in order for Facebook Messenger to be able to get the object's URL later?
It seems like this shouldn't be the case, as opening this new functionality of sharing through messenger should be just about getting rid that friction when sharing a story.
does the user need to be logged in to Facebook?
No, he doesn't.
does the user need to be logged in to Facebook in my app?
You must have a valid client token, which means your user must have authorized your app. Just once. Then he can log out from Facebook and/or your app, and you can keep the token on your database and make as many requests as you want, regardless of the user being logged in anywhere.
That means: After the user logs out from facebook, you still get to keep the client token for as long as you want (Well, they do expire: take a look at https://developers.facebook.com/docs/facebook-login/access-tokens/ for more info), and use it to make requests on behalf of the user as you please, using any of the permissions your app was granted by the user (read messages, send messages, post on my behalf, etc.).
In order to share an open graph story through facebook messenger, there must be a story to share published somewhere, of course.
Take on account privacy settings may prevent user/app A from seeing a user/app B story shared by someone else (user/app C) if user/app A didn't have permission to see the original post in the first place (happens when posting with 'only to friends' privacy setting, for example)
The best you can do: debug the responses your app is getting from Facebook. Every time something unusual occurs Facebook will notify you. Are you sure you are not getting any errors/warning messages?

In IOS 5 how do we login to twitter from our application?

All the tutorial I found explains how to tweet and show an alert message if users cannot tweet.
What about if user hasn't logged in to twitter yet and I want to help user logged in to tweeter.
Basically we want to allow user to sign up to our services via facebook and twitter. We've taken care of facebook. Now we need to so it for twitter.
This are samples of tutorial I found
http://www.raywenderlich.com/5519/beginning-twitter-in-ios-5
I don't want to tweet. I just want to login first so I can store the users' twitter id on my database allowing it to save bookmarks, etc..
All I see is https://dev.twitter.com/docs/ios. It's not clear whether we have to compute the sig manually, do we have to open safari or what.
Did you go through api documentation on twitter integration to ios?
Here is a similar question.May be this will help you
If you want your users to login with their twitter accounts, you will have to register your application with Twitter to obtain a key to sign your requests. You can read more about this on Twitter Developer Page

Are oauth_token and oauth_verifier sufficient parameters for persistent isLoggedIn?

I'm learning to use the twitter API for the first time. I want to build a website that allows users to post messages to their twitter, facebook and linkedin account. They will need to sign up first via the website's registration/authentication system, which is in not related to twitter, facebook and linkedin. Once logged in, they should be able to synchronize their twitter, facebook and linked in account with my website.
I'm starting development with twitter first. I followed this tutorial here:
http://www.1stwebdesigner.com/tutorials/twitter-app-oauth-php/
After authenticating, twitter sends me to this url.
http://mywebsite.com/?oauth_token=o7gIh4x8xAs1mcms6OKthLoLecL99WVbky2Gu6o4no&oauth_verifier=83Ip3jrMVDvnbIY3RXS5DH1FUZrWAHddwApnOBfm4
The first time this page loads, it properly retrieves all the authenticated user info. But when I refresh the page, the all the user info disappears.
My question is:
Are the query string parameters oauth_token=o7gIh4x8xAs1mcms6OKthLoLecL99WVbky2Gu6o4no&oauth_verifier=83Ip3jrMVDvnbIY3RXS5DH1FUZrWAHddwApnOBfm4 all that's needed to gain write access to a user's twitter account? Can I store these tokens in my database so that the user never has to be prompted to sign into twitter again?
You had better keep oauth_token (and oauth_token_secret too) in your database since you will use them for all the authenticated requests you will do for the authenticated user. As for oauth_verifier, it is a parameter only used during the OAuth Authentication flow. So you can get rid of it once you have got the final tokens.
For further details (and to ensure what you are doing is right), see the corresponding "Sign in with Twitter" page on Twitter Developers website : https://dev.twitter.com/docs/auth/implementing-sign-twitter.

Resources