Comments (15)
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
from facebook-ios-sdk.
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:
_permissions = [[NSArray arrayWithObjects:
@"publish_stream",@"read_stream",@"offline_access",nil] retain];
_session = [[Session alloc] init];
_facebook = [[_session restore] retain];
if (_facebook == nil) {
_facebook = [[[[Facebook alloc] init] autorelease] retain];
} else {
NSData *cookiesdata = [[NSUserDefaults standardUserDefaults] objectForKey:@"FBCookies"];
NSArray *cookies = [NSKeyedUnarchiver unarchiveObjectWithData:cookiesdata];
NSHTTPCookie *cookie;
for (cookie in cookies) {
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:cookie];
}
}
in userInfoDidLoad:
[_session setSessionWithFacebook:_facebook andUid:_userInfo.uid];
[_session save];
NSData *cookiesdata = [NSKeyedArchiver archivedDataWithRootObject:[[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]];
[[NSUserDefaults standardUserDefaults] setObject:cookiesdata forKey:@"FBCookies"];
from facebook-ios-sdk.
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.
from facebook-ios-sdk.
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.
from facebook-ios-sdk.
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.
from facebook-ios-sdk.
It still gives me the same error unless I store the cookies in NSUserDefaults along with the access token and expiration date.
from facebook-ios-sdk.
Can you try theRunAround again and see if this is still the case?
from facebook-ios-sdk.
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."
from facebook-ios-sdk.
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.
from facebook-ios-sdk.
OK it seems to be working now, thanks!
from facebook-ios-sdk.
Cool!
from facebook-ios-sdk.
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.
from facebook-ios-sdk.
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?
from facebook-ios-sdk.
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
from facebook-ios-sdk.
Well now it looks like it's working again, so hopefully it will stay that way!
from facebook-ios-sdk.
Related Issues (20)
- iOS Facebook SDK lost session regularly HOT 1
- Facebook SDK(dynamic) Validation Failed in Unity
- Facebook Login doesn't open the App when Installed HOT 5
- App switches to limited login. HOT 10
- Facebook SDK automatic app events logging with StoreKit2 HOT 2
- Static Framework as a swift package
- Access Token Expiration error HOT 1
- Build error with FBAudienceNetwork.xcframework: Signature cannot be verified HOT 2
- ld: symbol(s) not found for architecture arm64 (Flutter) HOT 5
- iOS SDK API does not work even after performing all requested actions
- Privacy manifests only included in release 17.0.0 with breaking changes HOT 11
- Xcode15.3: After updating SDKv17.0.0 through SPM, an error occurred while running the project: dyld [5199]: Library not loaded: @ rpath/FBSDKCoreKit. framework/FBSDKCoreKit, unable to start the application HOT 12
- unity sdk 17.0.0 how date update ?
- App is live but only approved testers can login (using limited login on 17.0.0) HOT 6
- Limited Login Failed on iOS 17 HOT 2
- Facebook Login using SDK 17.0.0 always displays a limited login warning HOT 2
- Warning Issue with FBAudienceNetwork 6.15.0 Upgrade via Cocoapods HOT 1
- m.facebook.com
- apps.microsoft.com
- Get wrong first name from `Profile.current?.firstName`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facebook-ios-sdk.