我想从iOS登录Facebook但没有任何反应。没错,没什么。
我的登录代码:
// Initialize a session object
FBSession *session = [[FBSession alloc] init];
// Set the active session
[FBSession setActiveSession:session];
if (![session isOpen]) {
NSLog(@"Not opened!");
[FBSession openActiveSessionWithReadPermissions:@[@"basic_info"]
allowLoginUI:YES
completionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
}];
}
else {
NSLog(@"Opened!");
}
if ([session isOpen]) {
NSLog(@"Now opened!");
}
else {
NSLog(@"Still not opened!");
}
输出:
没有打开!
还没打开!
我填写.plist并在Facebook上创建应用并填写Bunde ID,iPhone应用商店ID
的.plist
<key>CFBundleURLSchemes</key>
<array>
<string>fb2136301454xxxxx</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb2136301454xxxxx</string>
</array>
</dict>
</array>
<key>FacebookAppID</key>
<string>2136301454xxxxx</string>
<key>FacebookDisplayName</key>
<string>PowzyConnect</string>
我不知道问题出在哪里,但会议没有开放。