Skip to content
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

logout method causing app crash #95

Closed
rklus16 opened this issue Apr 9, 2016 · 4 comments
Closed

logout method causing app crash #95

rklus16 opened this issue Apr 9, 2016 · 4 comments

Comments

@rklus16
Copy link

rklus16 commented Apr 9, 2016

In iOS, after setting the user identity successfully, then I try to log the user out the app crashes and I get this log in the console.

2016-04-08 19:24:18.743 myApp[2100:433852] start logout
2016-04-08 19:24:18.744 myApp[2100:433852] start getInstance
2016-04-08 19:24:19.330 myApp[2100:433852] -[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0xb00000000010f7e5
2016-04-08 19:24:19.334 myApp[2100:433852] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber isEqualToString:]: unrecognized selector sent to instance 0xb00000000010f7e5'
*** First throw call stack:
(0x1815cae38 0x180c2ff80 0x1815d1ccc 0x1815cec74 0x1814ccd1c 0x10018bb44 0x100194b2c 0x100182280 0x100645a7c 0x100645a3c 0x10064b4e4 0x181580dd8 0x18157ec40 0x1814a8d10 0x182d90088 0x18677df70 0x10002c658 0x1810468b8)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

xcode also displays this line in [BNCPreferenceHelper setUserIdentity:] as the issue.

<+116> at BNCPreferenceHelper.m:293

@renesansz
Copy link
Contributor

@rklus16 , Some I can't produce the issue you've reported.
Can you provide specific steps on how to replicate the error?
Also please provide the details of your setup (eg: cordova version, plugin versions, etc..)

@rklus16
Copy link
Author

rklus16 commented Apr 11, 2016

Cordova version: 6.1.1
iOS platform version: 4.1.1
Branch plugin version: 2.0.9

We have it setup that when a user logs into our system a user id is returned which we use for setIdentity method like so.

user_id = 1111; // returned user id
Branch.setIdentity(user_id);

Once the user logs out we call the logout method.

Branch.logout();

@rklus16
Copy link
Author

rklus16 commented Apr 11, 2016

Works for android.

For iOS, I'm using Xcode Version 7.3 (7D175). I don't know if that would be an issue though.

@rklus16
Copy link
Author

rklus16 commented Apr 11, 2016

I think I've figured out the issue. I was passing in the id as a json object. I thought on callback it was already stringified but I guess not. JSON.stringify seems to have fixed the issue.

@rklus16 rklus16 closed this as completed Apr 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants