Pregunta

In my app, I'm looking to allow my users to post a single status to both Facebook and Twitter. I've got my own compose window, so I'd like to avoid using the built-in SLComposeViewController, since it's not necessary.

In my searches, I've not found any good tutorials on how to directly post to either Twitter or Facebook using the iOS6 stuff, it's all with the built-in composer, and the docs have proven somewhat obtuse to my weary eyes.

Any pointers to tutorials, sample code, or even a pointer in the right direction would be appreciated.

¿Fue útil?

Solución

Grab both the user's Twitter and Facebook accounts from ACAccountStore, and then just make two calls to SLRequest--one for your Twitter post and another for Facebook.

Here's the class reference for SLRequest.

And check out these examples for Facebook and Twitter.

It's also worth noting that Facebook has their own SDK alternative to SLRequest, which allows for more customization of requests to include FQL, batch requests, etc. Depending on the specificity of your requirements, you may want to check it out.

Otros consejos

Use ACAccountStore to check whether Facebook and twitter is configured in user's iPhone setting ,then use Graph api for facebook and twitter rest api for Twitter to post/tweet without showing the UI using SLRequest Class.For facebook ,you also have to configure your app on its [developer portal]:https://developers.facebook.com/apps .

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top