gpt4 book ai didi

ios - Facebook iOS SDK 集成在 Appdelegate.m 中显示错误

转载 作者:行者123 更新时间:2023-12-01 18:16:37 25 4
gpt4 key购买 nike

在 htttps://developer.facebook.com 中,他们使用 API 调用示例登录,他们要求在我的应用程序 delegate.m 文件中输入以下代码

// Whenever a person opens the app, check for a cached session
if (FBSession.activeSession.state == FBSessionStateCreatedTokenLoaded) {

// If there's one, just open the session silently, without showing the user the login UI
[FBSession openActiveSessionWithReadPermissions:@[@"basic_info"]
allowLoginUI:NO
completionHandler:^(FBSession *session, FBSessionState state, NSError *error) {
// Handler for session state changes
// This method will be called EACH time the session state changes,
// also for intermediate states and NOT just when the session open
[self sessionStateChanged:session state:state error:error];
}];

它向我显示了这样的错误----'AppDelegate'没有可见的@interface声明'sessionStateChanged:state:error:'
提前致谢...

最佳答案

根据上面的链接,您必须在您的应用程序委托(delegate)中添加此方法。但是您可以根据您的状态 View 自定义此方法(状态 == FBSessionStateOpen ...等)

// This method will handle ALL the session state changes in the app
- (void)sessionStateChanged:(FBSession *)session state:(FBSessionState) state error:(NSError *)error
{
// If the session was opened successfully
// customize your code...
}

关于ios - Facebook iOS SDK 集成在 Appdelegate.m 中显示错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21379045/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com