Closed Nidhi30 closed 6 years ago
I have a problem too.
We have a fix that grabs the top view controller in the view controller stack when you call [TWTRTwitter loginWithCompletion:]
, which should fix the issue you're having here. You can use the method [TWTRTwitter loginWithViewController:withCompletion]
and specify the view controller we should present safari on top of, which will also fix the issue you are dealing with here. Hope that helps!
@rajul-arora, hi there, give us example please by code
how to implement it.
@rajul-arora, in my case, the following error occurs
Error: Request failed: forbidden (403)
I encountered this issue. I think this is related to that Callback Urls get required from June. https://developer.twitter.com/en/docs/basics/callback_url.html How to fix this?
Having same issue as what @alpamys-qanybet had.
Tried both [TWTRTwitter loginWithCompletion:]
and [TWTRTwitter loginWithViewController:withCompletion]
mentioned by @rajul-arora on the post above.
Both failed with error : Error: Request failed: forbidden (403)
@taichi-jp, @SSHuiqin , @rajul-arora , @Nidhi30 , @oNguyenTamThi , never mind,
problem was with callback url in twitter dev console.
it must be:
twitterkit-CONSUMER_KEY://
for iOS
twittersdk://
for Android
if I hasn't installed the twitter app, it will open the web auth page.It seems ok.
If I install the twitter app, it will open the twitter app to auth, but when I cancel return to my app, it open the twitter web page authorization. Why? Now repeatedly evoke, how can I only evoke an authorization once? @alpamys-qanybet @rajul-arora
I have the same issue, web view appears on cancel or authorize button in twitter app (only when twitter app is installed). Any solutions on this?
I am trying to login with Twitter, but if twitter is not installed it is not allowing me to login via safari, It is giving this kind if warning Warning: Attempt to present <UINavigationController: 0x10787d000> on <UINavigationController: 0x1080b0e00> whose view is not in the window hierarchy! here is my code
in appdelegate
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { TWTRTwitter.sharedInstance().start(withConsumerKey: "Consumarkey", consumerSecret: "Secret") }
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
TWTRTwitter.sharedInstance().logIn(completion: { (session, error) in if (session != nil) { let user_id = session?.userID self.type = social.twitter.rawValue DELEGATE.dicSocialSignUpData.setValue(String(user_id!), forKey: "socialId") self.socialid = user_id! let client = TWTRAPIClient.withCurrentUser() client.loadUser(withID: userid!, completion: { (user, error) in if user != nil { let name = user!.name if name.contains("") { let seprated_name = name.components(separatedBy: " ") self.firstname = seprated_name[0] self.lastname = seprated_name[1] } else { self.firstname = name } DELEGATE.dicSocialSignUpData.setValue(user!.name, forKey: "name") DELEGATE.dicSocialSignUpData.setValue(user!.profileImageURL, forKey: "profile_image") self.image = user!.profileImageURL } client.requestEmail { email, error in if (email != nil) { self.emailR = "(String(describing: email!))" DELEGATE.dicSocialSignUpData.setValue(String(describing: email!), forKey: "email") } else { print("error: (String(describing: error?.localizedDescription))"); } let store = TWTRTwitter.sharedInstance().sessionStore if let userID = store.session()?.userID { store.logOutUserID(userID) } self.socialLogin(social_id: "(String(describing: session?.userName))", social_type: social.twitter.rawValue) } })
Also seted callback url twitterkit-ConsumerKey://
pods I used TwitterCore (3.1.0) TwitterKit (3.3.0)