-
-
Notifications
You must be signed in to change notification settings - Fork 877
Twitter login cancellation crashes app #1474
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@nlutsenko I saw #348 i had created this issue five days back but didn't get any response. I tried looking for answers on Stackoverflow also. I have checked twitter authentication related posts but could not find any answer. Setting callback URL is mentioned at many place. I have set it in my app dashboard and able to login also. Could you please suggest what could be the issue? |
Hi Ashish It's hard to be certain exactly what's failing without more code for context, but line 61 in that file looks like this:
The error occurs because one (or more) of the variables after the ':' in the dictionary literal evaluate to nil at the time of the crash. My advice would be to set a breakpoint on that line and recreate the crash scenario. Once you hit that line, you'll be able to use the debugger to find out which of the variables is nil. You will likely be able to work from there to ensure that it isn't nil. I hope this helps. EDIT: Looking at the reason for this code, it seems odd that you would be hitting this if you're cancelling your login. Perhaps I've misunderstood your case, but if your user cancels their Twitter login, then you wouldn't want to call any 'login' methods. |
@ashish-naik Also, you've specified that this occurs when you don't use ParseUI. Do you know whether ParseUI behaves better? |
@drdaz I was using ParseUI but replaced that with my custom classes because Sign in with Apple is not available yet and added email/password based authentication. Not sure whether i was hitting this issue then with ParseUI. I tried with the breakpoint. See attached screenshot. All variables are nil. I have also attached screenshots of Twitter screens. Steps to reproduce are
This is happening on iOS 12.2 simulator and 13.3 device, simulator yes after cancel i dont need to handle login but exception occurs before my login handler is called after Cancel. Does this help? |
This looks like a bug. I don't use the Twitter login feature myself, and I can't seem to test it using the ParseUI Demo project, so it's a little hard for me to reproduce. But it looks like it's trying to authenticate the user even though they pressed cancel. Which is... wrong. |
@drdaz No i am not trying to authenticate after cancel. My PFTwitterUtils.logIn { (loggedInUser, error) call opens the login page and then i wait to check error if any but control does not return. |
So I've just taken a look at the Twitter auth code, and it's very outdated. It still assumes that iOS has local Twitter accounts, which hasn't been the case for several years. Do you absolutely need Twitter login? Looking at the state of things in there, if you can avoid it, do so. Otherwise, perhaps you can take a look at the code causing the trouble. I can't spend much time on it right now. |
That's just my opinion btw; the opinion of a guy who hasn't attempted to use the Twitter login feature at all before today. If anybody else has been using it successfully, by all means chime in. |
No I can remove Twitter. Thanks for looking in. |
FWIW I abandoned Twitter as an authentication provider for the reasons above. Even back then it was in a bit of a mess and didn't take into account the changes that Twitter has made. |
Uh oh!
There was an error while loading. Please reload this page.
I am using Twitter authentication without ParseUI framework.
When i initiate twitter auth session using
PFTwitterUtils.logIn { (loggedInUser, error) in
, the Twitter login page opens.i am able to login using valid credentials.
But if i tap Cancel and then tap Return to app then app crashes with below error at line 61 in PFTwitterAuthenticationProvider.m
*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]
Parse/TwitterUtils (1.17.3)
iOS 13.2.2 simulator
i tried breakpoints to catch flow in my code but crash happens before control returns to
PFTwitterUtils.logIn { (loggedInUser, error)
What could be the issue?
Thanks
Ashish
The text was updated successfully, but these errors were encountered: