在iOS上使用React Native和React Native Navigation进行社交登录后的黑屏

时间:2018-06-28 12:41:38

标签: ios react-native react-native-navigation react-native-fbsdk

在Facebook或Google上登录后,在iOS中,当应用返回到前台时,整个屏幕为空白,并且仅显示一个小吃栏。

我正在使用react-native-fbsdk和react-native-googlesignin我的appDelegate.m看起来完全像fbsdk库中建议的那样,因此我怀疑这是一个问题。

@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  NSURL *jsCodeLocation;
  [GMSServices provideAPIKey:@"xxxxxxxxxxxxxxxx"];

  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  self.window.backgroundColor = [UIColor whiteColor];
  [[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation launchOptions:launchOptions];

  [[FBSDKApplicationDelegate sharedInstance] application:application
                           didFinishLaunchingWithOptions:launchOptions];

  return YES;
}

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
            options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {

  BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
                                                                openURL:url
                                                      sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
                                                             annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
                  ];
  // Add any custom logic here.
  return handled;
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
  [FBSDKAppEvents activateApp];
}

Navigation.startSingleScreenApp({
  screen: {
    screen: 'akun.Cover',
    navigatorStyle: {
      navBarHidden: true
    }
  },
  drawer: {
    right: {
      screen: 'akun.Drawer',
      passProps: {},
      disableOpenGesture: false,
      fixedWidth: 700
    },
    style: {
      drawerShadow: false,
      contentOverlayColor: 'rgba(0,0,0,0.25)',
      leftDrawerWidth: 75,
      rightDrawerWidth: 50
    },
    type: 'TheSideBar',
    animationType: 'facebook',
    disableOpenGesture: false
  },
  passProps: {},
  animationType: 'fade'
})

 return (error, result) => {
      Snackbar.show({
        title: t(this.props.language, 'completeSignUp'),
        duration: Snackbar.LENGTH_SHORT
      })
      this.props.navigateTo({
        screen: 'akun.Registro',
        backButtonHidden: true,
        animated: true,
        passProps: {
          provider,
          user_id: this.state.user_id
        },
        animationType: 'slide-horizontal'
      })
    }
  • React Native Navigation版本:v1.1.473
  • 原生版本:0.51.0
  • 平台(iOS,Android还是同时使用这两种平台?):iOS
  • 设备信息(模拟器/设备?操作系统版本?调试/发布?):模拟器和设备,调试

0 个答案:

没有答案