gpt4 book ai didi

ios - react-native FBSDK LoginManager 不工作

转载 作者:行者123 更新时间:2023-12-01 20:07:40 25 4
gpt4 key购买 nike

我的 LoginButton 工作,但我的 LoginManager 没有。

handleLogin = () => {
LoginManager.logInWithReadPermissions(['public_profile']).then(
function(result) {
if (result.isCancelled) {
alert('Login cancelled');
} else {
alert('Login success with permissions: '
+ result.grantedPermissions.toString());
}
},
function(error) {
alert('Login fail with error: ' + error);
}
)
}

当调用 handleLogin() 时,它会将我引导至显示此内容的 xcode。

/** * Copyright (c) 2015-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */

import

import "AppDelegate.h"

int main(int argc, char * argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate > class])); } }



在我的 xcode 控制台中,错误显示了这一点,

2016-07-14 17:04:36.591 asklegit[2749:839107] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayI objectAtIndex:]: index 4 beyond bounds [0 .. 3]'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110e5cd85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010fd1bdeb objc_exception_throw + 48
2 CoreFoundation 0x0000000110d45934 -[__NSArrayI objectAtIndex:] + 164
3 asklegit 0x000000010f344640 -[RCTBatchedBridge _handleRequestNumber:moduleID:methodID:params:] + 368
4 asklegit 0x000000010f343600 __33-[RCTBatchedBridge handleBuffer:]_block_invoke.460 + 1424
5 libdispatch.dylib 0x0000000114637d9d _dispatch_call_block_and_release + 12
6 libdispatch.dylib 0x00000001146583eb _dispatch_client_callout + 8
7 libdispatch.dylib 0x00000001146401ef _dispatch_main_queue_callback_4CF + 1738
8 CoreFoundation 0x0000000110db60f9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
9 CoreFoundation 0x0000000110d77b99 __CFRunLoopRun + 2073
10 CoreFoundation 0x0000000110d770f8 CFRunLoopRunSpecific + 488
11 GraphicsServices 0x0000000115d0ead2 GSEventRunModal + 161
12 UIKit 0x0000000112fb8f09 UIApplicationMain + 171
13 asklegit 0x000000010f2c7cff main + 111
14 libdyld.dylib 0x000000011468c92d start + 1
15 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

有人有什么想法吗?

最佳答案

通过删除对以前使用的 facebook 登录包或文件的任何引用解决了这个问题。我之前使用的是 react-native-facebook-login 中的 FBLoginManager,然后我将其从 xcode 中删除,并且 FBSDK LoginManager 可以正常工作!

关于ios - react-native FBSDK LoginManager 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38387368/

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