1

I have a parse app in the appstore already. I'm about to submit an update for the app using the latest Parse SDK 1.7.4 and I noticed the manual parse login IS NOT WORKING!

I hope this is due to my code and not a parse issue.

Here is the code:

[PFUser logInWithUsernameInBackground:username password:password block:^(PFUser *user, NSError *error) {        
if (!error) {
   //do stuff with user
} else { 
   //error handling here     
}

I of course did some search on the internet to find an answer and most people are saying not to use the background functions because things need to run on the main thread. And I tried using the dispatch async and forced it to run on the main thread but still no callback from the login.

Here is the error message I'm getting:

-[BFTask isFaulted]: unrecognized selector sent to instance  
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BFTask isFaulted]: unrecognized selector sent to instance

When I run the below code:

NSError *error;
PFUser *user = (PFUser *)[PFUser logInWithUsername:username password:password error:&error];
if (error) {
   //do error handling here
} else {
   //do stuff with user object here and go to logged in screen.
}

Also, I want to note, I have this:

NSString *const BFTaskMultipleExceptionsException = @"BFMultipleExceptionsException";

in my AppDelegate just to be able to compile and run the app ever since I upgraded to Parse 1.7.4 SDK.

These are the errors I get if I take out this line from the AppDelegate:

  "_BFTaskMultipleExceptionsException", referenced from:
      ___53+[PFObject(Private) deleteAllAsync:withSessionToken:]_block_invoke226 in Parse(PFObject.o)
      ___65+[PFObject(Private) _deepSaveAsync:withCurrentUser:sessionToken:]_block_invoke319 in Parse(PFObject.o)

Here is a question that's similar to this in Parse blogs that's not really solved:

https://www.parse.com/questions/ios-sdk-loginwithusernameinbackgroundpasswordblock-does-not-execute-block-on-error-case

halfer
  • 19,824
  • 17
  • 99
  • 186
C0D3
  • 6,440
  • 8
  • 43
  • 67
  • http://stackoverflow.com/a/30523757/1702413 – TonyMkenu Jun 18 '15 at 21:25
  • try to update to the last Bolts vers 1.2.0 https://github.com/BoltsFramework/Bolts-iOS/releases/tag/1.2.0 – TonyMkenu Jun 18 '15 at 21:28
  • Thanks for the link @TonyMkenu but copying the bolts framework to project and then linking it didn't work. It's giving me this error: duplicate symbol _OBJC_IVAR_$_BFAppLinkTarget._URL in: /Users/kaanersan/Projects/../Bolts.framework/Bolts(BFAppLinkTarget.o) /Users/kaanersan/Projects/../FacebookSDK.framework/FacebookSDK(BFAppLinkTarget.o) – C0D3 Jun 18 '15 at 21:35
  • I'm gonna try updating to Bolts 1.2.0 now – C0D3 Jun 18 '15 at 21:36
  • Nope, still same error with Bolts 1.2.0 unfortunately. The duplicate symbol error. I'm gonna try taking it out and running. – C0D3 Jun 18 '15 at 21:38
  • Yeah, when I take out the Bolts framework, I'm back to this error: Undefined symbols for architecture arm64: "_BFTaskMultipleExceptionsException", referenced from: ___53+[PFObject(Private) deleteAllAsync:withSessionToken:]_block_invoke226 in Parse(PFObject.o) ___65+[PFObject(Private) _deepSaveAsync:withCurrentUser:sessionToken:]_block_invoke319 in Parse(PFObject.o) without the const string in the AppDelegate code as I was mentioning in the question. – C0D3 Jun 18 '15 at 21:40
  • http://stackoverflow.com/questions/25840546/facebooksdk-and-bolts-conflicting-each-other-duplicate-symbols-on-build – TonyMkenu Jun 18 '15 at 21:42
  • These still don't work properly. I created a parse project from scratch and that works of course but still don't know how to fix my existing project which is a pain. – C0D3 Jun 23 '15 at 17:15
  • Have you tried removing all Parse-related libraries from the project, downloading the most recent libraries and configuring it again? – B.R.W. Jun 25 '15 at 13:27
  • I did, but not completely. I'm going to try that again. BFTaskMultipleExceptionsException line as I mentioned in the question frustrates me. I don't want that in the project at all. – C0D3 Jun 25 '15 at 19:53

1 Answers1

3

Unfortunately I cannot comment on your question (not enough reputation), but it seems you have an old FacebookSDK in your project. Xcode gives you a duplicate symbols error, which is caused by the fact that your (old) FacebookSDK has Bolts integrated. The moment you integrate it from the Parse SDK, you have it effectively two times in your project, resulting in the duplicate symbols error.

Please update your FacebookSDK to the last v3 version, available here. Then, use the latest ParseSDK, and include everything from Parse (also ParseUI, Bolts, etc, everything from their SDK folder EXCEPT the v4Facebook framework) into your project.

This should do the trick and your method:

[PFUser logInWithUsernameInBackground:username password:password block:^(PFUser *user, NSError *error) {        
if (!error) {
   //do stuff with user
} else { 
   //error handling here     
}

should work.

eschanet
  • 1,063
  • 6
  • 15
  • Ohhhhh buddy that was it. I tried removing and re-adding the libraries but I think the issue is that Parse isn't compatible with Facebook's newest SDK (v4) so last v3.23.2 worked. Thank you so much for your help. – C0D3 Jun 29 '15 at 00:05
  • 1
    I gave you your points :) Also one thing to mention is that I had to include libstdc++.6.dylib in the project to get rid of the errors I got after re-adding all of Parse and FB libraries. – C0D3 Jun 29 '15 at 00:06
  • Great to hear you solved your problem. You should check against the list on the Parse QuickStart Guide, they have listed all the required libraries there. – eschanet Jun 29 '15 at 07:26