Authentication works on simulator, fails on device

ios
oauth
swift

#1

I’m facing a strange issue developing an iOS app that has a twitter timeline embedded into it. It works perfectly well on the simulator but on the device it doesn’t load any tweets and Xcode gives me this error:

2015-12-10 20:37:01.595 AppDemo[350:36411] [TwitterKit] Couldn’t load tweets from TWTRTimelineViewController: Error Domain=TwitterAPIErrorDomain Code=32 “Request failed: unauthorized (401)” UserInfo={NSErrorFailingURLKey=https://api.twitter.com/1.1/statuses/user_timeline.json?count=30&exclude_replies=true&include_retweets=true&screen_name=twitterUsername, NSLocalizedDescription=Request failed: unauthorized (401), NSLocalizedFailureReason=Twitter API error : Could not authenticate you. (code 32)}


#2