'FBSession:未提供AppID [英] 'FBSession: No AppID provided

查看:75
本文介绍了'FBSession:未提供AppID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚使用适用于iOS的新Facebook 3.0 SDK更新了我的应用程序.在此之前,我使用的是使用FBSessionDelegate和FBRequestDelegate的SDK.在该SDK中,我们必须将此代码放置在applicationDidFinishLaunching中:

I just updated my app with the new Facebook 3.0 SDK for iOS. Prior to this I was using the SDK that utilized FBSessionDelegate and FBRequestDelegate. In that SDK, we had to place this code in the applicationDidFinishLaunching:

 facebook = [[Facebook alloc] initWithAppId:FB_APP_ID andDelegate:self];

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if ([defaults objectForKey:@"FBAccessTokenKey"] 
    && [defaults objectForKey:@"FBExpirationDateKey"]) {
    facebook.accessToken = [defaults objectForKey:@"FBAccessTokenKey"];
    facebook.expirationDate = [defaults objectForKey:@"FBExpirationDateKey"];
} 

但是,现在有了新的3.0 SDK,我被告知我们要做的就是导入框架和资源束,然后将名为FacebookAppID的ID添加到束* .plist中",所以我已经做到了,但是当我在其中调用任何带有FBSession的代码时,出现此错误:

However now with the new 3.0 SDK, I'm told that all we have to do is import the framework, and resource bundles, then "add id named FacebookAppID to the bundle *.plist" So I've done this, but when I call any code with FBSession in it, I'm getting this error:

 'FBSession: No AppID provided; either pass an AppID to init, or add a string valued key with the appropriate id named FacebookAppID to the bundle *.plist'

我做错了什么?

推荐答案

@Kwame我遇到了同样的问题,您的会话对象缺少App ID.为此,您可以在info.plist中添加一个名为FacebookAppID的密钥,并使用facebook提供给您的ios应用的应用ID设置适当的值.或者,如果已经完成此操作,则可以通过在- (id)initWithAppID:(NSString*)appID permissions:(NSArray*)permissions urlSchemeSuffix:(NSString*)urlSchemeSuffix tokenCacheStrategy:(FBSessionTokenCachingStrategy*)tokenCachingStrategy;方法中设置适当的值来以编程方式设置应用程序ID.另外,请在info.plist中交叉检查应用ID的值.希望这可以帮助.

@Kwame I faced the same problem , you session object is missing the App id . For this you can add an key in the info.plist named FacebookAppID and set the appropriate value with the app id provided to your ios app by facebook. or if in case you have already done this you can set the app id programmatically by setting the appropriate values in the - (id)initWithAppID:(NSString*)appID permissions:(NSArray*)permissions urlSchemeSuffix:(NSString*)urlSchemeSuffix tokenCacheStrategy:(FBSessionTokenCachingStrategy*)tokenCachingStrategy; method . Also please cross check the value of app id in info.plist. Hope this helps.

这篇关于'FBSession:未提供AppID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆