Posts

Showing posts with the label twitter

How to return value from a Closure in Swift?

Image
Clash Royale CLAN TAG #URR8PPP How to return value from a Closure in Swift? So I am using fabric plugin/Twitter-kit to use twitter api in my application. I want to get the image URL of profile picture of a celebrity. here is my code below. func getImageURL(celebrity :String) -> String{ var imageURL = "" let client = TWTRAPIClient() let statusesShowEndpoint = userSearch let params = ["q": celebrity, "page" : "1", "count" : "1" ] var clientError : NSError? let request = client.URLRequestWithMethod("GET", URL: statusesShowEndpoint, parameters: params, error: &clientError) client.sendTwitterRequest(request) { (response, data, connectionError) -> Void in if connectionError != nil { print("Error: (connectionError)") } do { let json = try NSJSONSerialization.JSONObjectWithDat...

Twitter oAuth callbackUrl - localhost development

Image
Clash Royale CLAN TAG #URR8PPP Twitter oAuth callbackUrl - localhost development Is anyone else having a difficult time getting Twitters oAuth's callback URL to hit their localhost development environment. Apparently it has been disabled recently. http://code.google.com/p/twitter-api/issues/detail?id=534#c1 Does anyone have a workaround. I don't really want to stop my development It worked for me by setting twitter callback url to my real website url. While testing in localhost -> twitter signup, redirected to localhost (instead of website url). – Sudhakar Krishnan Aug 22 '16 at 8:01 17 Answers 17 Alternative 1. Set up your .hosts (Windows) or etc/hosts file to point a live domain to your localhost IP. such as: 127.0.0.1 xyz.com where xyz....