gpt4 book ai didi

ios - Twitter 登录 - 已完成登录但未重定向到我的应用程序

转载 作者:可可西里 更新时间:2023-11-01 06:21:24 26 4
gpt4 key购买 nike

正如标题所描述的,它停留在那个状态。我没有找到搜索网络的解决方案。不存在错误...使用 ios swift

附上图片(希伯来文):它基本上说:“将您重定向回应用程序,可能需要一些时间……”

'Youre being redirected' page

代码: AppDelegate-

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

FBSDKApplicationDelegate.sharedInstance().application(application, didFinishLaunchingWithOptions: launchOptions)

var configureError: NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
assert(configureError == nil, "Error configuring Google services: \(configureError)")

Fabric.with([Twitter.self])

return true
}


//deprecaed - for support
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
let directedByFB = FBSDKApplicationDelegate.sharedInstance().application(application, open: url, sourceApplication: sourceApplication, annotation: annotation)
let directedByGoogle = GIDSignIn.sharedInstance().handle(url as URL!, sourceApplication: sourceApplication,annotation: annotation)
return directedByFB || directedByGoogle
}


func application(application:UIApplication, openURL url: URL, options: [String: AnyObject]) -> Bool {
if Twitter.sharedInstance().application(application, open: url, options: options) {
return true
}
return GIDSignIn.sharedInstance().handle(url as URL!, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication.rawValue] as? String, annotation: options[UIApplicationOpenURLOptionsKey.annotation.rawValue])
}

SocialChooserViewController - TWTRAPIClient 完成回调未被调用..(它没有重定向回我的应用程序)

@IBAction func continueLoginWithTwitter() {
Twitter.sharedInstance().logIn(withMethods: [.webBased]) { session, error in
guard session != nil else {
print("error connecting with Twitter: \(error?.localizedDescription)");
return
}
self.chosenMedia = .twtr
let client = TWTRAPIClient(userID: session!.userID)
client.loadUser(withID: session!.userID) { (unwrappedTwtrUser, error) in
guard let twtrUser = unwrappedTwtrUser, error == nil else {
print("Twitter : TwTRUser is nil, or error has occured: ")
print("Twitter error: \(error!.localizedDescription)")
return
}
_ = self.user.set(firstAndFamilyName: twtrUser.name)
self.user.set(imageURL: twtrUser.profileImageMiniURL)
self.user.set(token: session!.authToken)
self.performSegue(withIdentifier: "toProfileVC", sender: self)
}
}
}

中学:至于我所问的,我还想更改权限页面上显示的应用程序 bieng 的名称,该怎么做?

权限页面:

enter image description here

最佳答案

回答:委托(delegate)有更多更新的方法,twitter 正在调用已弃用的方法(正如您在上面看到的),但我实际上并没有在内部处理 twitter - 所以没有所有的东西都在更新的方法下并且工作得很好并且有条理:

func application(_ application:UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey: Any]) -> Bool {
print("called")
let directedByFB = FBSDKApplicationDelegate.sharedInstance().application(application, open: url, options: options)
let directedByTWTR = Twitter.sharedInstance().application(application, open: url, options: options)
let directedByGGL = GIDSignIn.sharedInstance().handle(url as URL!, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as? String, annotation: options[UIApplicationOpenURLOptionsKey.annotation])
return directedByGGL || directedByTWTR || directedByFB
}

关于ios - Twitter 登录 - 已完成登录但未重定向到我的应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42039359/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com