I did one login by PFUser, then rebuild my project to launch my app again, then the PFUser.current() is not nil, but the sessionToken is nil, therefore I cannot save object to PFUser.current() object.
Any suggestion?
Thank you in advanced!
I've the same issue, need to re-login every time. What a mess!!!!
Hi men, same here.
After we re built the project with xCode 8 and swift 3 at every run the current User session Token property is nil and is not stored, whereas any other property still works out.
Any ideas?
Same behaviour on parse.com and parse-server (v 2.2.17)
Thank's
Michele
We found the solution!
Apple changed the way of working with keychain in iOS 10. To fix this issue you simply should go to Targets->Capabilities and enable keychain sharing (it enables access to keychain for your app):
from: http://stackoverflow.com/questions/38689631/how-to-use-facebook-ios-sdk-on-ios-10/38799196#38799196
Just spent 2 hours trying to work out why users don't work on iOS 10 / Xcode 8...
On second launch of the app every call to fetchIfNeeded on _User returned a 404 with the Parse Server logging 101 - "Object not found".
This is the solution!
Thank you so much Viktormax!
I have the issue. Any suggestion?
"enable keychain sharing" helps me! thank you!
If anyone runs into this, I turned on keychain sharing and still had the issue. I had to clean, delete the app, and reinstall to get things to work properly.
This issue has been automatically marked as stale because it has not had recent activity. If you believe it should stay open, please let us know! As always, we encourage contributions, check out the Contributing Guide
Never had this before, but it's suddenly happening constantly, only one one device (my dev device). Happens on old releases of our app and new, after full uninstall+reinstall+device restart, full Xcode build cleaning+build folder cleaning+derived data removal+ everything else you can think of, everything mentioned above on this thread — keeps happening.
Just started today.
Really sucks. Any ideas? Thanks in advance!
A bit of context, as I've just read some of https://github.com/parse-community/parse-server/issues/4897
Earlier today I updated my Parse iOS SDK from 1.15.3 to 1.17.2. This updated code was only ever run on my dev device, the one that the issue is now happening on. I subsequently went back to an old build running 1.15.3, and have since gone back and forth among a bunch of different builds from recent weeks, only the very newest of which run anything but 1.15.3. In the course of doing this I have repeatedly fully uninstalled the app, restarted my phone, cleaned the crap out of Xcode, etc. I've also deleted all the users I signed up or logged in as while running SDK 1.17.2 from my parse-server mongo database (have done this repeatedly).
Can it possibly be the case that simply having run this code once on my device somehow corrupted it for good in this specific way? How?? I feel like that can't possibly be it. But.. what else explains it?
Something that seems to clinch the theory, though without explaining anything: When I go back to running the newest builds, the one that run 1.17.2, the problem goes away.
Tried a slightly adapted version of the cloud job shown here — no luck.
A bit more context. PFKeychainStore logs this error message when an attempt is made to save the session token following a login:
PFKeychainStore failed to set object for key 'currentUser', with error: -25299
Which leads me here.
Now going to be investigating how a duplicate keychain has gotten left on the device despite a full uninstall+reinstall.
What @tekmick said over here reminded me about the policies of this open source project in general... I have a hunch y'all are gonna say we just need to permanently update to the latest SDK version. Will probably plan to do that.
Got a solution. Used the FDKeychain library and added the following code right after my call to PFUser.logOut():
do {
try FDKeychain.deleteItem(forKey: "currentUser", forService: "<bundle_id>.com.parse.sdk")
print("deleted currentUser from keychain!")
} catch {
print("tried to delete currentUser from keychain; wasn't there!")
}
Fixes it again each time it's been broken.
As I understand it, this was fixed in 1.17.2?
And did this problem only occur on your development device? As you understand it, will it only happen when going back and forth between SDK versions? No production users affected?
I had this issue on my main dev device. When testing with another device it didn't have any problem at first, but after going back to the older Parse SDK version it started happening on the other device too.
My main concern: how likely is this to happen in production?
Sorry Claes; I haven't thought about this since we came up with that workaround in March.
Ok, thanks for letting me know :-)
Most helpful comment
We found the solution!
Apple changed the way of working with keychain in iOS 10. To fix this issue you simply should go to Targets->Capabilities and enable keychain sharing (it enables access to keychain for your app):
from: http://stackoverflow.com/questions/38689631/how-to-use-facebook-ios-sdk-on-ios-10/38799196#38799196