简体   繁体   English

React-Native FBSDK LoginButton仅在iOS中崩溃

[英]React-Native FBSDK LoginButton crashes app in iOS only

I'm setting up react-native-fbsdk on my app and I was able to configure everything and fix all the errors that showed up, but now whenever I click the LoginButton from FBSDK my app crashes in iOS, but in Android everything works fine. 我在我的应用程序上设置react-native-fbsdk,能够配置所有内容并修复所有显示的错误,但是现在每当我从FBSDK单击LoginButton时,我的应用程序在iOS中崩溃,但在Android中一切正常。

This is what I tried to do: 这是我尝试做的:

  • Changing publishPermissions to readPermissions; publishPermissions to readPermissions;更改publishPermissions to readPermissions;

  • Adding #import <FBSDKLoginKit/FBSDKLoginKit.h> in AppDelegate.m 在AppDelegate.m中添加#import <FBSDKLoginKit/FBSDKLoginKit.h>

  • Upgraded the iOS SDK to v4.31.0 and changed the info.plist 将iOS SDK升级到v4.31.0并更改了info.plist

to: 至:

<key>FacebookAppID</key>
<string>000000000000</string>
<key>FacebookDisplayName</key>
<string>AppName</string>
<key>LSApplicationQueriesSchemes</key>
<array>
    <string>fbapi</string>
    <string>fb-messenger-share-api</string>
    <string>fbauth2</string>
    <string>fbshareextension</string>
</array>
  • Reinstalled fbsdk package from 0. 从0重新安装了fbsdk软件包。

The behaviour is the same without any errors on debug mode. 行为是相同的,在调试模式下没有任何错误。

What else can I do to solve this problem? 我还能做些什么来解决这个问题?

Adding @Rafael Motta answer to my info.plist fixed my problem: 在我的info.plist中添加@Rafael Motta答案可以解决我的问题:

  <key>CFBundleURLTypes</key>
  <array>
    <dict>
      <key>CFBundleURLSchemes</key>
      <array>
        <string>fb[app-id]</string>
      </array>
    </dict>
  </array>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM