0

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!

YJ Choi
  • 157
  • 2
  • 8

1 Answers1

0

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.

Superian007
  • 395
  • 7
  • 25