看来,这似乎是一种重复,但我已经通过围绕该问题提出的所有问题,而且我似乎仍然无法为我所想。
我在Facebook开发点跟踪了Sitorial,我做了以下工作:
- Created a Facebook App to get the Facebook App ID.
- I ve assigned this App ID to a constant and I use it to initialize the Facebook object within my app.
- I ve made sure my app is flagged for multitasking
- I ve setup the fbAPP_ID in the plist under the URLs drop down
- I ve made my AppDelegate a FBSessionDelegate and implemented very simple fbDidLogin and fbDidNotLogin delegate methods.
FCCC/SBI/2008/8。
All of this and I still can t seem to get Facebook to return control back to my app when it authorizes. It just stays in Facebook instead.
法典(注FB_APP_ID) 此处改为基本数字
AppDelegate.h:
#import <UIKit/UIKit.h>
#import "FBConnect.h"
#define FB_APP_ID @"1234567890"
@interface AppDelegate : UIResponder <UIApplicationDelegate, FBSessionDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (nonatomic, strong) Facebook* facebook;
@end
AppDelegate.m:
#import "AppDelegate.h"
@implementation AppDelegate
@synthesize window = _window;
@synthesize facebook = _facebook;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
_facebook = [[Facebook alloc] initWithAppId:FB_APP_ID andDelegate:self];
if (![_facebook isSessionValid])
{
[_facebook authorize:nil];
}
}
- (BOOL)application:(UIApplication*)application handleOpenURL:(NSURL *)url
{
return [_facebook handleOpenURL:url];
}
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [_facebook handleOpenURL:url];
}
- (void)fbDidLogin
{
NSLog(@"App logged in");
}
- (void)fbDidNotLogin:(BOOL)cancelled
{
NSLog(@"App did not login");
}
@end
有关信息:
Facebook Appeck(大部分是 out):
Note: I tried it with only basic settings and also with the iOS Native app settings with a fake iTunes store ID but the same bundle ID from my provisioning profile.
不管怎样,我总是装上“Facebook”,要求授权我,然后,它只是关闭了 screen窗,坐在我的“Facebook”屏幕上,而不是回到我的手上。
同样值得注意的是:我知道,它总是会问,因为我不去检查th子和到期日......这是下一步。
我是否在这里错过了东西? 否则,我会设法使Facebook回到我的身边吗?
EDIT:同样,在偷渡时,我似乎找不到出于某种原因要求开放URL的任何地点。
EDIT #2:在模拟器上运行时,它通过Safari(按预期)装载FB Dialog,然后当我授权时,聋ari人就犯了错误,因为他们试图用URL返回我的手脚:
我在Info.plist中知道,自我的第1234567890号合同确立以来,这仍然给我说了很多话。