Hi,
I’m just getting to terms with the Twitterkit git. I’ve created an iOS app that I can log users into and then save the basic details of each user…that’s fine.
However the user banner image, location and a few other details aren’t returned as part of the LoadUser data response, so I have to request these details separately. After successfully signing in I call the following function but I get the following error?
I used the sample code from the Wiki on Twiterkit (e.g. userId “20” hardcoded in) and that works? …But I then hardcoded my own Twitter userId in the param and it doesn’t work, just returns the following error?
Request failed: not found (404)" UserInfo={NSLocalizedFailureReason=Twitter API error : No status found with that ID. (code 144)
func fetchTwitterTweet() {
let statusesShowEndpoint = "https://api.twitter.com/1.1/statuses/show.json"
let userID = TWTRTwitter.sharedInstance().sessionStore.session()?.userID
var clientError : NSError?
if let userID = TWTRTwitter.sharedInstance().sessionStore.session()?.userID {
let params = ["id": userID]
// used "20" hardcode in param before and it worked?
let client = TWTRAPIClient(userID: userID)
// make requests with client
let request = client.urlRequest(withMethod: "GET", urlString: statusesShowEndpoint, parameters: params, error: &clientError)
client.sendTwitterRequest(request) { (response, data, connectionError) -> Void in
if connectionError != nil {
print("Error: \(connectionError)")
}
do {
let json = try JSONSerialization.jsonObject(with: data!, options: [])
print("json: \(json)")
} catch let jsonError as NSError {
print("json error: \(jsonError.localizedDescription)")
}
}
}