Ios 使用twitter登录总是返回错误

Ios 使用twitter登录总是返回错误,ios,swift,twitterkit,Ios,Swift,Twitterkit,我正在尝试添加twitter登录,但我无法获得回复。每次我收到错误消息(获取用户身份验证令牌时出错)。我知道有很多这样的帖子有这个问题,但我不能登录。我也尝试过,但我得到了零次。我还重新生成了使用者密钥和密码,但运气不佳。使用swift 3.0 这是我的密码 TWTRTwitter.sharedInstance().logIn(with: self) { (session, error) in if (session != nil) { print("signed in as

我正在尝试添加twitter登录,但我无法获得回复。每次我收到错误消息(获取用户身份验证令牌时出错)。我知道有很多这样的帖子有这个问题,但我不能登录。我也尝试过,但我得到了零次。我还重新生成了使用者密钥和密码,但运气不佳。使用swift 3.0

这是我的密码

TWTRTwitter.sharedInstance().logIn(with: self) { (session, error) in
     if (session != nil) {
     print("signed in as \(session?.userName ?? "")");
            } else {
                print("error: \(error?.localizedDescription ?? "")");
            }
     }
info.plist

Appdelegate

更新:
如果我们有应用程序,那么它工作正常,但如果没有,那么它返回错误。

经过大量的研发,我获得了成功。Twitter已经强制回拨url。我从中发现

您需要在twitter仪表板设置的回拨url中添加twitterkit-xxxxxxxxxxxxxx(twitterkit消费者密钥)

我使用此方法打开safari(确保添加safari框架)


经过大量的研发,我获得了成功。Twitter已经强制回拨url。我从中发现

您需要在twitter仪表板设置的回拨url中添加twitterkit-xxxxxxxxxxxxxx(twitterkit消费者密钥)

我使用此方法打开safari(确保添加safari框架)


请遵循Twitter工具包安装指南,另一种方法是使用fabric@MuhammadUsman不久fabric就不支持twitter了。是的,我的错,只是再次检查。不管怎样,我通常使用twitter工具包集成twitterdocumentation@MuhammadUsman是的,我也有,但他们没有提供所有步骤,在某个阶段,你像我一样卡住了,请至少提供downvoteFollow Twitter工具包安装指南的原因,另一种方法是使用fabric@MuhammadUsman不久fabric就不支持twitter了。是的,我的错,只是再次检查。不管怎样,我通常使用twitter工具包集成twitterdocumentation@MuhammadUsman是的,我也有,但他们没有提供所有的步骤,有一个阶段你像我一样坚持,请至少提供否决投票的理由
 func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        _ = DBSingleton.sharedInstance
        TWTRTwitter.sharedInstance().start(withConsumerKey:TwitterKey.consumerKey, consumerSecret:TwitterKey.consumerSecret)
}
TWTRTwitter.sharedInstance().logIn(with: self) { (session, error) in
            if (session != nil) {
                print("signed in as \(session?.userName ?? "")");
            } else {
                print("error: \(error?.localizedDescription ?? "")");
            }
        }