Use API Twitter to send Tweet in Sandbox - twitter

I'm using API twitter to send Tweet on my profile and it works.
I read the documentation but I don't find any method to send "test" tweet.
I'd like to create some fake tweets to check if my code is working properly.
At the moment I use .post("statuses/update"

There is no simple way to test the APIs. You have to use Twitter developer app Credentials The detail regarding the app permission and developer can be found in documentation.

Related

How can My App Tweet the Contents a User Submits?

Note: I am posting this because I don't even know what to Google search. I know we're all about thorough research before asking these questions. Any help would be appreciated.
Scenario: User writes a text post from my app and when they submit it, the content is added to a Parse.com class (I know how to do this) and simultaneously it is tweeted from a designated twitter account (that does not belong to the user) let's say #MyCoolAppThatTweets.
In other words, I don't want the user via my app to be permanently logged into #MyCoolAppThatTweets twitter account, but have one-time access to send a tweet from it.
Another way to phrase this question would be: How can my app log into a specific twitter account whose credentials I can "bake" into the app without compromising the security of that twitter account.
I am already aware that normally, users of an iOS app wouldn't automatically want their content being tweeted. For the project I'm making, this is not going to be a concern (it's a secret).
If you need more information or if I need to post this elsewhere, please let me know!
From your question I am not sure if you are familiar with "Twitter part" of Parse.com and Twitter REST API. If not please start by reading this https://www.parse.com/docs/ios/guide#users-twitter-users (or take a look on official Twitter way by using their plugin called Fabric: https://dev.twitter.com/)
Since you mentioned PFUser I will describe you how to achieve it by using Parse.com API.
First your user must be logged in to Twitter account.
I suppose that your user is already logged in into your app as a PFUser so best way to log him into some Twitter account is by linking Twitter account with existing PFUser - https://www.parse.com/docs/ios/guide#users-linking.
After that you can post tweets through user's Twitter account (if permission was granted). I recommend doing that using Parse.com Twitter API calls https://www.parse.com/docs/ios/guide#users-login-amp-signup. To create API requests you need official Twitter REST API which can be obtained here https://dev.twitter.com/docs/api.

Integrating twitter login in IOS

In my IOS app i Want to add twitter login in order to fetch the user's information like Name, Email ID and Profile picture.Can anyone please provide me some useful information or some tutorial link that can help in integrating twitter login in my app and to fetch user information.
If you're just trying to do some really simple login stuff and are new to iOS, I would definitely check out Parse's Twitter Login tools.
https://parse.com/docs/ios_guide#twitterusers/iOS
Really user friendly and simple to get the hang of.
If you want to add twitter login to your app in a simple way, I would recommend you to use Fabric framework. Follow this link: https://dev.twitter.com/fabric/ios
Note: You can't bring user's email easily. You need to get permissions from twitter by filling a form in twitter website or else by sending email to fabric team.
Twitter Kit provides all the required functionalities and mechanism for making authenticated requests to Twitter's REST API.
Follow the configuration process here.
Using TWTRSession, you can request for TWTRUser object and that will have what you need.
This is the right way and advisable one too.

Is there a way to get write access to twitter api without mobile authentication?

I am currently working out of india and am trying to get to make my app post on behalf of my Twitter user account. However, for me to be able to do this, I need to create write access to my app on twitter, which I tried to. Unfortunately, twitter gives me the following error:
Error
You must add your mobile phone to your Twitter profile before granting your application write capabilities. Please read https://support.twitter.com/articles/110250-adding-your-mobile-number-to-your-account-via-web for more information
Now, I tried to add my mobile phone number following these instructions. Twitter, does not support any of the Indian mobile carriers in order to authenticate the same.
Is there a work around? Is there any way I can make write access work from here?
There are two ways to do this.
The official way to do this is to contact the Twitter API team directly using this form https://support.twitter.com/forms/platform
The unofficial way is
Authenticate against mobile.twitter.com (use your phone or computer).
Go to Settings
Go to Phone
Add
Add your mobile
A "manage" link should be available
All being well, you'll get a confirmation SMS
I've not tried this method - but I have seen other people say it works.

which rest api can be used to get the message sent from other twitter account to my twitter account

Assume I have one twitter account called "A", any other people who have twitter account can send message to me without following me. How to get these messages using Twitter REST API?
Which document describes this API?
I find the API should be direct_messages
https://dev.twitter.com/docs/api/1.1/get/direct_messages
Using twitcurl C++ libary, I can get the direct_messages from other twitter user

IOS twitter feed tutorial

I am currently building an app where they require all their users to be able to view their feeds only.
I looked at a lot of tutorials online which talk about the new api v1.1 of twitter and now authentication is required at all times.
I see a lot of examples and even successfully followed several of them like
http://www.appcoda.com/ios-programming-101-integrate-twitter-and-facebook-sharing-in-ios-6/
I even saw a tutorial posted on the twitter dev page.Following all of these focused on a few key elements
Using ACAccount to retrieve the account settings of the current user
Using the SLRequest to encapsulate the HTTP request made to the twitter api
Retrieving the data in JSON format, parsing it and presenting it to the user
Well my question is, I do not want user specific feeds. It's like a company updates their twitter regularly, users using the app should get feeds regarding the company. So I was wondering if there was a way, the app provides some default or hard coded authentication information ?
Is there some sort of tutorial, library or anything out there to help me move in the correct direction ?
Thank You for your time and help.
Your going to want to implement the following API call to get that information:
https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline
Once your application is authorized you can make a call to,
https://dev.twitter.com/docs/api/1.1/get/statuses/MorleyGaelsGAA.json
That should give you the information you're looking for.

Resources