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)
- Actual Facebook iOS sdk integration guide? HOT 2
- Facebook Login iOS SDK Authentication Token Has No Signature HOT 4
- App crashes when FacebookLogin is linked to non application target
- I cant find FBSDKLoginManager class in login kit. HOT 3
- "GraphAPI, iOS" via Limited Login has inconsistent behavior and inconsistent documentation
- @jjiang10, please take a look at https://github.com/facebook/facebook-ios-sdk/issues/2152 HOT 4
- GraphRequest `/me` fails on v17+
- Facebook Login UI Issue HOT 5
- Will the limited login warning still display after implementing limited login? HOT 4
- (Reopen) FBSDKLog: starting with Graph API v2.4, GET requests for /{appId}/model_asset should contain an explicit "fields" parameter
- its looks like this app isn't available,Facebook login not working for non administrative/testers users, mobile app react native HOT 14
- WARNING: Don't upgrade to FBSDK v17 without supporting Limited Login (the Changelog is misleading) HOT 9
- Login works in limited login only and no way to switch to use 'classic' mode with access to graph api HOT 2
- Some users receiving a link broken message when proceeding with limited login HOT 3
- Facebook SDK 17.0.0 "Instant Games" Application Type cannot get `token_for_business`
- Facebook business login in flutter HOT 1
- Unable to open the game using a scheme URL in Messenger
- Facebook Events doesn't work on Flutter App
- Event Parameters Blocked on Stock SDK Install
- {com.facebook.sdk:FBSDKErrorArgumentNameKey=videoURL, com.facebook.sdk:FBSDKErrorDeveloperMessageKey=Must refer to an asset file., com.facebook.sdk:FBSDKErrorArgumentValueKey=/var/mobile/Media/DCIM/100APPLE/IMG_0201.MOV}
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.