-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Restoring sessions not working #5
Comments
Thanks for your report. We know this issue and the reason is that when the app is restarted, though we had save the correct access token, but the cookie for the webview dialog is not kept. We are working on a way to resolve that. Thanks |
OK, well I hope it gets fixed. Here's my workaround method that seems to be working (with the general setup used in the Run Around example) if anyone else is trying to do this- in viewDidLoad:
in userInfoDidLoad:
|
I just ran into this same issue, thanks for the workaround. edit - couldn't get the workaround working. issue still persists. i may just go back to the facebook-iphone-sdk as it was 100x simpler to use. |
For this issue, it turns out to be much simpler to just store the access token string and expiration date with NSUserDefaults. Then, restore it when we want to use it again by invoking the method in Facebook class isSessionValid. |
Preserve and reset the cookie is not recommend way. I just make a server side change which will accept a persistent cookie. Now this issue should be resolved. |
It still gives me the same error unless I store the cookies in NSUserDefaults along with the access token and expiration date. |
Can you try theRunAround again and see if this is still the case? |
It's still happening in theRunAround. If I log in, post something, then completely quit the app (not just make it in the background in iOS 4), then open the app again and try to post, I get the error "An error occurred with -MyFacebookApp-. Please try again later." |
You can first try on ios 3.2 by changing the base sdk. For iOs4, if you are using simulator, boot from xcode, it will reinstall the app again and the persistent cookie would not be there. let me know thx. |
OK it seems to be working now, thanks! |
Cool! |
I think I spoke too soon- I am using the Simulator so I don't know if this is an issue with the phone as well, but if I log in, quit the simulator (4.0), then start the simulator (not booting from xcode), and open theRunAround app again, I still get the error. I can't test on a phone though to see if you turn the phone off and back on if it would give the error but it's something you might want to check. |
I use the 4.0 simulator also and did not see this repro.. it works for me. Just in case, I have some minor fix recently, you have been updating for that is that correct? if yes you can also try the app id 230820755197 for the runAround? |
I updated the files, and it works for app id 230820755197, but not for the app id for my app... do you know what could be happening? my app id is 115402728275 |
Well now it looks like it's working again, so hopefully it will stay that way! |
Fix running of SwiftCatalog sample on device.
Everything is working great when I first run my app (or when I run the Run Around sample app). I can log in and publish to stream.
However, when I close the app, then reopen (having stored the session information in NSUserDefaults as in the Run Around example), then I try to publish to stream, the dialog just displays the message "An error occurred with . Please try again later." (I checked and the session expiration date is a long way off, and all of the session variables seem to have been stored + restored properly).
This happens both in my app and in the Run Around sample app when I close them, storing session info, and then open them again and try to run publishStream. Is there a working way to restore a session that you could give example code for? It's pretty important for my app.
Thanks!
The text was updated successfully, but these errors were encountered: